Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have recently compiled a new kernel for my linux server. It is almost identical with the previous kernel (I added cifs support). Because physical access to the server is limited, I configured grub to fallback to the old kernel if the new kernel failed to boot cleanly. I can now boot the server, but I don't know which kernel is running.

I tried doing "uname -a" and it gives me the kernel name followed by #2. Is the #2 relevant to my problem?

How can I find out which of the two possible kernels is running? Ideally I'd like to relate it to the order listed in my grub.conf

share|improve this question
1  
The #2 would be the number of times a kernel has been built in that source tree. If you keep the source between recompiles, you can use this to identify the kernel, but be aware that all of these kernels have installed their modules into the same path. –  Simon Richter Feb 28 '12 at 7:01
add comment

3 Answers

up vote 3 down vote accepted

You can "tag" your kernel to identify it later on.
In menuconfig, go to "General Setup" -> "Local version - append to kernel release"
Any string you enter there will be displayed by uname as suffix to your kernel version.

share|improve this answer
add comment
$ ls /proc/fs

...should show cifs if you're on the new kernel.

share|improve this answer
    
Great - thanks. That at least answers my direct question. I'll leave it open for a while, in case someone has the general answer. –  Dominic Cronin Feb 27 '12 at 22:33
add comment

Another answer to this is cat /proc/cmdline

This shows the path to the kernel and any command line parameters that were used.

example.

cat /proc/cmdline

BOOT_IMAGE=/boot/vmlinuz-3.2.0-17-generic root=UUID=b33290c0-553a-4fd1-af00-b82017923b88 ro ipv6.disable=1 splash quiet vt.handoff=7

share|improve this answer
1  
that's not generally true, on gentoo i get this output: root=/dev/md1 video=vesafb:ywrap,mtrr,1024:768-16@85 panic=10 –  Niko S P Feb 27 '12 at 22:39
1  
Yep. You are right I messed this one up. Niko has a better answer. –  lostinip Feb 27 '12 at 22:43
    
What I see with /proc/cmdline is more or less what is configured in grub.conf, so perhaps if an additional parameter were added in grub.conf, this might work. –  Dominic Cronin Feb 28 '12 at 13:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.