Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Which kernel am I running?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
chrisstankevitz
Guru
Guru


Joined: 14 Dec 2003
Posts: 472
Location: Santa Barbara, CA, USA

PostPosted: Tue Jul 13, 2004 3:11 am    Post subject: Which kernel am I running? Reply with quote

How do I know which kernel I'm running?

uname -a shows a particular date:
Code:
bash-2.05b# uname -v
#4 SMP Sun Jul 4 09:21:58 PDT 2004


This seems to imply /boot/kernel-2.4.26:
Code:
bash-2.05b# ls -l /boot/System.map* /boot/kernel*
-rw-r--r--  1 root root  614970 Dec 15  2003 /boot/System.map-2.4.23
-rw-r--r--  1 root root  617305 Jul  4 09:33 /boot/System.map-2.4.26
-rw-r--r--  1 root root  617305 Jul 12 17:50 /boot/System.map-2.4.26-2004071200
-rw-r--r--  1 root root 1299185 Dec 15  2003 /boot/kernel-2.4.23
-rw-r--r--  1 root root 1312058 Jul  4 09:33 /boot/kernel-2.4.26
-rw-r--r--  1 root root 1312058 Jul 12 17:50 /boot/kernel-2.4.26-2004071200


But this doesn't agree with grub.conf/dmesg which say linux-2.4.26-2004071200 is loaded (note references to "gas=pass"):

Code:
bash-2.05b# dmesg | grep "Kernel command line"
Kernel command line: root=/dev/sda3 acpi=off gas=pass


Code:
bash-2.05b# cat /boot/grub/grub.conf
default 2
timeout 30
# splashimage=(hd0,0)/grub/spash.xpm.gz

title=Gentoo Linux (acpi off, vga off) [good]
root (hd0,0)
kernel (hd0,0)/kernel-2.4.23 root=/dev/sda3 acpi=off

title=linux-2.4.26
root (hd0,0)
kernel (hd0,0)/kernel-2.4.26 root=/dev/sda3 acpi=off

title=linux-2.4.26-2004071200
root (hd0,0)
kernel (hd0,0)/kernel-2.4.26-2004071200 root=/dev/sda3 acpi=off gas=pass


What's really bothering me is that my kernel-2.4.26-2004071200 (which I hope is running) should have MTRR enabled, but it doesn't:
Code:
bash-2.05b# grep MTRR /boot/config-2.4.26-2004071200
CONFIG_MTRR=y


Code:
bash-2.05b# ls -l /proc/mtrr
ls: /proc/mtrr: No such file or directory


So, which kernel am I running?

If you say kernel-2.4.26, I'd ask "what about the gas=pass evidence in dmesg?"

If you say kernel-2.4.26-2004071200, I'd ask "what's with the date in uname?" and "why isn't MTRR running?".

Thanks so much!

Chris
Back to top
View user's profile Send private message
didl
Retired Dev
Retired Dev


Joined: 09 Sep 2003
Posts: 1106
Location: Pittsburgh, PA

PostPosted: Tue Jul 13, 2004 3:28 am    Post subject: Re: Which kernel am I running? Reply with quote

chrisstankevitz wrote:
How do I know which kernel I'm running?

uname -a shows a particular date:
Code:
bash-2.05b# uname -v
#4 SMP Sun Jul 4 09:21:58 PDT 2004



Code:

uname -r


will do the job. Check out

Code:

man uname


for more info.
Back to top
View user's profile Send private message
chrisstankevitz
Guru
Guru


Joined: 14 Dec 2003
Posts: 472
Location: Santa Barbara, CA, USA

PostPosted: Tue Jul 13, 2004 3:47 am    Post subject: Re: Which kernel am I running? Reply with quote

didl wrote:


Code:

uname -r


will do the job.


uname -r just gives the revision number. But I have two potential kernels with the same version and I wonder which of those two I'm running.
Back to top
View user's profile Send private message
John5788
Advocate
Advocate


Joined: 06 Apr 2004
Posts: 2140
Location: 127.0.0.1

PostPosted: Tue Jul 13, 2004 5:04 am    Post subject: Reply with quote

nuh uh, your wrong. uname -r gives you kernel release, which kernel you are using.

[quote=manpage]
-r, --kernel-release
print the kernel release
[/quote]

uname -v just tells you like.. how many times youve compiled that kernel release basically.
_________________
John5788
Back to top
View user's profile Send private message
chrisstankevitz
Guru
Guru


Joined: 14 Dec 2003
Posts: 472
Location: Santa Barbara, CA, USA

PostPosted: Tue Jul 13, 2004 6:20 am    Post subject: Reply with quote

John5788 wrote:
nuh uh, your wrong. uname -r gives you kernel release, which kernel you are using.


No, you don't understand. I have two kernels in my /boot with the same kernel release. Both kernels are version 2.4.26. (see my ls above) I want to know which of the two 2.4.26 kernels on my hard drive I am running.

Thank you!

Chris
Back to top
View user's profile Send private message
John5788
Advocate
Advocate


Joined: 06 Apr 2004
Posts: 2140
Location: 127.0.0.1

PostPosted: Tue Jul 13, 2004 6:30 am    Post subject: Reply with quote

OH, ok sry, check your bootloader config. what are you using? grub or lilo
_________________
John5788
Back to top
View user's profile Send private message
chrisstankevitz
Guru
Guru


Joined: 14 Dec 2003
Posts: 472
Location: Santa Barbara, CA, USA

PostPosted: Tue Jul 13, 2004 9:13 am    Post subject: Reply with quote

John5788 wrote:
OH, ok sry, check your bootloader config. what are you using? grub or lilo


I'm using grub. I posted my grub.conf above.

Thanks,

Chris
Back to top
View user's profile Send private message
didl
Retired Dev
Retired Dev


Joined: 09 Sep 2003
Posts: 1106
Location: Pittsburgh, PA

PostPosted: Tue Jul 13, 2004 1:55 pm    Post subject: Reply with quote

chrisstankevitz wrote:

No, you don't understand. I have two kernels in my /boot with the same kernel release. Both kernels are version 2.4.26. (see my ls above) I want to know which of the two 2.4.26 kernels on my hard drive I am running.


First of all, I'd strongly recommend that next time you recompile your kernel
you make sure to change the Makefile to reflect the proper kernel release
(which should be exactly what you have named it in your grub.conf,
e.g. 2.4.26-2004071200). Then uname -r will work and there is no question
as to what kernel you are running.
Second, your grub.conf has the line

Quote:

default 2


which will cause grub to load the third entry in your kernel list (counting starts with 0!)
assuming you didn't select a different kernel "by hand".
This also matches the kernel command line you quote from dmesg and
you are probably running kernel-2.4.26-2004071200.
Thirdly, just because you copied kernel-2.4.26-2004071200 into /boot on
July 12th does NOT mean that it was compiled on July 12th. Likely you
accidentally copied a second copy of kernel-2.4.26 into /boot and just named
it kernel-2.4.26-2004071200 which probably is also why MTRR doesn't work.

Hence, properly name your kernels in the Makefile and you will always
know whats going on :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum