[Techtalk] Grub defaults after new kernel image install

Carla Schroder carla at bratgrrl.com
Tue Jul 25 15:14:23 UTC 2006

On Tuesday 25 July 2006 07:48, Gina Lanik wrote:
> Hiya,
> I'm updating a few of our RHEL servers at work, which in some case also
> means a newer kernel image. Now I seem to recall that if in grub.conf the
> "default" line was set to anything other than 0, this would be honored on a
> new kernel image install so the server would boot from the "old" already
> existing and former default kernel. Is my memory faulty or was this
> behavior changed some time ago?
> TIA & cheers,
> Gina

The kernel stanzas are numbered in order starting from 0, so you can make any 
of them the default. For example, if you have three different kernel stanzas 
you can make the third one the default with 'default 2'. I don't recall what 
happens when RHEL updates, you might have to configure this manually to get 
the one you want.

A slick trick is to use the 'savedefault' option, which probably isn't what 
you want, but I feel like telling about it anyway. :) If you are 
multi-booting or have multiple kernels, GRUB will boot whatever you booted to 
last, instead of always having the same default. It looks like this:

default		saved

title		Ubuntu, kernel 2.6.15-26-k7
root		(hd0,4)
kernel		/vmlinuz-2.6.15-26-k7 root=/dev/mapper/Ubuntu-root ro quiet splash
initrd		/initrd.img-2.6.15-26-k7

 Carla Schroder
 check out my "Linux Cookbook", the ultimate Linux user's
 and sysadmin's guide! http://www.oreilly.com/catalog/linuxckbk/

More information about the Techtalk mailing list