How to Add a New Grub Image

You may have different boot images for kernels that include different features. These days, as you get updated kernels for Fedora or RHEL, you simply load an RPM containing the new kernel and that new kernel is added to the grub.conf file as the default kernel to be booted. At boot time, you can choose which kernel you want.

If you build your own kernel, however, or get one to use from another source, you need to modify the grub.conf file yourself to tell Fedora or RHEL to boot that kernel. Here is the procedure for modifying the grub.conf file:

1) Copy the new image from the directory in which it was created (such as /usr/src/kernels/linux-2.6.11-5/arch/i386/boot) to the /boot directory. Name the file something that reflects its contents, such as bz-2.6.11-5. For example:

# cp /usr/src/linux-2.6.11-5/arch/i386/boot/bzImage /boot/bz-2.6.11-5

2) Add several lines to the /boot/grub/grub.conf file so that the image can be started at boot time if it is selected. For example:

title Fedora Core (My own custom build)
root (hd0,4)
kernel /bz-2.6.11-5 ro root=/dev/hda6
initrd /initrd-2.6.8.img

3) Reboot your computer.

4) Press Enter at the boot prompt. When the GRUB boot screen appears, move your cursor to the title representing the new kernel and press Enter.

The advantage to this approach, as opposed to copying the new boot image over the old one, is that if the kernel fails to boot, you can always go back and restart the old kernel. When you feel confident that the new kernel is working properly, you can use it to replace the old kernel or perhaps just make the new kernel the default boot definition.

Subscribe / Share

Article by Admin

Authors bio is coming up shortly. Read 528 articles by Admin
It's very calm over here, why not leave a comment?

Leave a Reply

You must be logged in to post a comment.