30.6. Verifying the Boot Loader
rpm, the kernel package creates an entry in the boot loader configuration file for that new kernel. However,
rpmdoes not configure the new kernel to boot as the default kernel. You must do this manually when installing a new kernel with
rpmto ensure that the configuration is correct. Otherwise, the system may not be able to boot into Red Hat Enterprise Linux properly. If this happens, boot the system with the boot media created earlier and re-configure the boot loader.
Table 30.1. Boot loaders by architecture
|x86||GRUB||Section 30.6.1, “Configuring the GRUB Boot Loader”|
|AMD AMD64 or Intel 64||GRUB||Section 30.6.1, “Configuring the GRUB Boot Loader”|
|IBM eServer System i||OS/400||Section 30.6.3, “Configuring the OS/400 Boot Loader”|
|IBM eServer System p||YABOOT||Section 30.6.4, “Configuring the YABOOT Boot Loader”|
|IBM System z||z/IPL|
30.6.1. Configuring the GRUB Boot Loader
/boot/grub/grub.conf, contains a few lines with directives, such as
hiddenmenu(the last directive has no argument). The remainder of the file contains 4-line stanzas that each refer to an installed kernel. These stanzas always start with a
titleentry, after which the associated
initrddirectives should always be indented. Ensure that each stanza starts with a
titlethat contains a version number (in parentheses) that matches the version number in the
kernel /vmlinuz-<version_number>line of the same stanza.
Example 30.2. /boot/grub/grub.conf
# grub.conf generated by anaconda [comments omitted] default=1 timeout=0 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux (2.6.32-22.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-22.el6.x86_64 ro root=/dev/mapper/vg_vm6b-lv_root rd_LVM_LV=vg_vm6b/lv_root rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet crashkernel=auto initrd /initramfs-2.6.32-22.el6.x86_64.img title Red Hat Enterprise Linux (2.6.32-19.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-19.el6.x86_64 ro root=/dev/mapper/vg_vm6b-lv_root rd_LVM_LV=vg_vm6b/lv_root rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet crashkernel=auto initrd /initramfs-2.6.32-19.el6.x86_64.img title Red Hat Enterprise Linux 6 (2.6.32-17.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-17.el6.x86_64 ro root=/dev/mapper/vg_vm6b-lv_root rd_LVM_LV=vg_vm6b/lv_root rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet initrd /initramfs-2.6.32-17.el6.x86_64.img
/boot/partition was created, the paths to the kernel and the
initramfsimage are relative to
/boot/. This is the case in Example 30.2, “/boot/grub/grub.conf”, above. Therefore the
initrdline in the first kernel stanza means that the
initramfsimage is actually located at
/boot/initramfs-2.6.32-22.el6.x86_64.imgwhen the root file system is mounted, and likewise for the kernel path (for example:
kernel /vmlinuz-2.6.32-22.el6.x86_64) in each stanza of
initrddirective must point to the location (relative to the
/boot/directory if it is on a separate partition) of the
initramfsfile corresponding to the same kernel version. This directive is called
initrdbecause the previous tool which created initial RAM disk images,
mkinitrd, created what were known as
initrdfiles. Thus the
initrdto maintain compatibility with other tools. The file-naming convention of systems using the
dracututility to create the initial RAM disk image is:
mkinitrd. For information on using Dracut, see Section 30.5, “Verifying the Initial RAM Disk Image”.
kernelline matches the version number of the
initramfsimage given on the
initrdline of each stanza. See Procedure 30.1, “Verifying the Initial RAM Disk Image” for more information.
default=directive tells GRUB which kernel to boot by default. Each
grub.confrepresents a bootable kernel. GRUB counts the
titled stanzas representing bootable kernels starting with
0. In Example 30.2, “/boot/grub/grub.conf”, the line
default=1indicates that GRUB will boot, by default, the second kernel entry, i.e.
title Red Hat Enterprise Linux (2.6.32-19.el6.x86_64).
grub.conf, we would need to change the
rpm, verify that
/boot/grub/grub.confis correct, change the
default=value to the new kernel (while remembering to count from
0), and reboot the computer into the new kernel. Ensure your hardware is detected by watching the boot process output.
0, GRUB will not display its list of bootable kernels when the system starts up. In order to display this list when booting, press and hold any alphanumeric key while and immediately after BIOS information is displayed. GRUB will present you with the GRUB menu.