Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > The Linux Kernel
Reload this Page How to determine kernel/initrd used during booting
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

The Linux Kernel Compiling, theory, programming or other discussion about the linux kernel

Reply
 
Thread Tools Display Modes
Old 05-09-2008   #1 (permalink)
Commander888
Just Joined!
 
Join Date: May 2008
Posts: 2
How to determine kernel/initrd used during booting

Does anyone know a way to determine which kernel/initrd file was used when the system booted?

There are appear to be symbolic links (vmlinuz, initrd) in /boot (in / on Ubuntu), which point to the most recent kernel. However, these links are really static and are not recreated during each boot cycle. Thus, they are not very reliable.

As an alternative approach to this problem, I was trying to scan all kernels listed /boot/grub/menu.lst for the current kernel version using something like this:

strings /boot/vmlinuz | grep `uname -r`

This seems to produce a build string with the exact version, build user and time. Does anybody know if this can actually be relied upon or is it just a fluke in my distribution?

Thanks in advance
Commander888 is offline   Reply With Quote
Old 05-11-2008   #2 (permalink)
sdimhoff
Linux Newbie
 
sdimhoff's Avatar
 
Join Date: Jan 2007
Posts: 115
uname -r should be reliable.

Good Luck
__________________
Linux since: 2001
Gentoo since: 2004
- - - - - - - -
Translation:
I fix things until they break.
sdimhoff is offline   Reply With Quote
Old 05-11-2008   #3 (permalink)
Commander888
Just Joined!
 
Join Date: May 2008
Posts: 2
> uname -r should be reliable.

There is no doubt that uname -r would produce a kernel version reliably

The question is how reliable the fact, that this version can be found in vmlinuz, is. After all, vmlinuz is compressed and the only real code is the loader/decompressor in the beginning. Technically, there is no guarantee that the version string would be present in the loader, but it does appear to be that way.
Commander888 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 07:30 AM.

Powered by vBulletin 3.6.8 ©2000 - 2007, content relevant URLs by vBSEO, Property of Core Root.

Content Relevant URLs by vBSEO 3.0.0