Wednesday, August 10, 2011

Selecting default OS or kernel in GRUB boot loader

If you are wishing to change the default OS or kernel in GRUB boot loader, you can easily make the changes

# vim /boot/grub/grub.conf

Change the  default=0 to 1 of other numeric if that is the kernel or OS you wish to use.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/sda1
#          initrd /boot/initrd-version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-238.19.1.el5.centos.plus)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.18-238.19.1.el5.centos.plus ro root=LABEL=/ rhgb quiet
        initrd /boot/initrd-2.6.18-238.19.1.el5.centos.plus.img
title CentOS (2.6.18-238.19.1.el5)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.18-238.19.1.el5 ro root=LABEL=/ rhgb quiet
        initrd /boot/initrd-2.6.18-238.19.1.el5.img

No comments: