Saturday 11 June 2011

Modify the system bootloader

This is a fairly open objective, Modify the system bootloader to do what?

As discussed in the previous post, you need to modify the grub.conf file, which by default is in the /boot/grub/ directory.

A sample grub.conf file is listed below:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda3
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.32-131.0.15.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-131.0.15.el6.x86_64 ro root=UUID=e9b35e95-5634-4891-8854-e4053f3fb350 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=uk crashkernel=auto rhgb quiet
        initrd /initramfs-2.6.32-131.0.15.el6.x86_64.img
title Red Hat Enterprise Linux (2.6.32-71.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-71.el6.x86_64 ro root=UUID=e9b35e95-5634-4891-8854-e4053f3fb350 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=uk crashkernel=auto rhgb quiet
        initrd /initramfs-2.6.32-71.el6.x86_64.img
Note how this server has two kernels installed and therefore two entries in the grub.conf file.
There is not that much more to say about this objective, really. Just play about with this file, change default kernel, menu title, timeout settings, kernel settings, but before you do make sure you have a  backup copy the of grub.conf file. e.g.:
cp /boot/grub/grub.conf grub.conf.bk

No comments:

Post a Comment