Testing a New Kernel in CentOS/Linux

Posted by Sheldon Finlay on February 03, 2009

So you just installed a new kernel and updated your grub.conf file. But you’re a little nervous about rebooting the server in case the new kernel doesn’t work out. Here’s a simple way to grub to reboot your new kernel just once. That way, if it fails, the machine can just be power-cycled and will reboot into the known to work kernel.

echo "savedefault --default=0 --once" | grub --batch

Change default=0 to which ever kernel you wish to boot once. Once you are done reboot:

shutdown -r now

Now remember, this will only boot that new kernel once. Subsequent reboots will end up booting the old default. So if everything is working like it should make sure to edit the grub.conf file and set the new kernel to be the default.

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

Comments