28.6. Verifying the Boot Loader
It is always recommended to double-check the boot loader configuration file after installing a new kernel with rpm
to ensure that the configuration is correct. Otherwise, the system may not be able to boot into Fedora properly. If this happens, boot the system with the boot media created earlier and re-configure the boot loader.
In the following table, find your system's architecture to determine the boot loader it uses, and then click on the "Refer to" link to jump to the correct instructions for your system.
28.6.1. Configuring the GRUB Boot Loader
GRUB's configuration file, /boot/grub/grub.conf
, contains a few lines with directives, such as default
, timeout
, splashimage
and 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 title
entry, after which the associated root
, kernel
and initrd
directives should always be indented. Ensure that each stanza starts with a title
that contains a version number (in parentheses) that matches the version number in the kernel /vmlinuz-<version_number>
line of the same stanza.
# 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/sda2
# initrd /initramfs-[generic-]version.img
#boot=/dev/sda
default=1
timeout=0
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.32.11-99.fc12.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32.11-99.fc12.x86_64 ro root=UUID=39e5f931-5dd5-4a90-a0cf-52996767d592 noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=dvorak rhgb quiet
initrd /initramfs-2.6.32.11-99.fc12.x86_64.img
title Fedora (2.6.32.10-90.fc12.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32.10-90.fc12.x86_64 ro root=UUID=39e5f931-5dd5-4a90-a0cf-52996767d592 noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=dvorak rhgb quiet
initrd /initramfs-2.6.32.10-90.fc12.x86_64.img
title Fedora (2.6.32.9-70.fc12.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32.9-70.fc12.x86_64 ro root=UUID=39e5f931-5dd5-4a90-a0cf-52996767d592 noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=dvorak rhgb quiet
initrd /initramfs-2.6.32.9-70.fc12.x86_64.img
Example 28.2. /boot/grub/grub.conf
If a separate
/boot/
partition was created, the paths to the kernel and the
initramfs
image are relative to
/boot/
. This is the case in
Example 28.2, “/boot/grub/grub.conf”, above. Therefore the
initrd /initramfs-2.6.32.11-99.fc12.x86_64.img
line in the first kernel stanza means that the
initramfs
image is actually located at
/boot/initramfs-2.6.32.11-99.fc12.x86_64.img
when the root file system is mounted, and likewise for the kernel path (for example:
kernel /vmlinuz-2.6.32.11-99.fc12.x86_64
) in each stanza of
grub.conf
.
The initrd directive in grub.conf refers to an initramfs image
In kernel boot stanzas in grub.conf
, the initrd
directive must point to the location (relative to the /boot/
directory if it is on a separate partition), of the initramfs
file corresponding to the same kernel version. This directive is called initrd
because the previous tool which created initial RAM disk images, mkinitrd
, created what were known as initrd
files. Thus the grub.conf
directive remains initrd
to maintain compatibility with other tools. The file-naming convention of systems using the dracut
utility to create the initial RAM disk image is: initramfs-<kernel_version>
.img
You should ensure that the kernel version number as given on the
kernel /vmlinuz-<kernel_version>
line matches the version number of the
initramfs
image given on the
initrd /initramfs-<kernel_version>
.img
line of each stanza. Refer to
Procedure 28.1, “Verifying the Initial RAM Disk Image” for more information.
The
default=
directive tells GRUB which kernel to boot
by default. Each
title
in
grub.conf
represents a bootable kernel. GRUB counts the
title
d stanzas representing bootable kernels starting with
0
. In
Example 28.2, “/boot/grub/grub.conf”, the line
default=1
indicates that GRUB will boot, by default, the
second kernel entry, i.e.
title Fedora (2.6.32.10-90.fc12.x86_64)
.
In
Example 28.2, “/boot/grub/grub.conf” GRUB is therefore configured to boot an older kernel, when we compare by version numbers. In order to boot the newer kernel, which is the
first title
entry in
grub.conf
, we would need to change the
default
value to
0
.
After installing a new kernel with rpm
, verify that /boot/grub/grub.conf
is 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).
If GRUB presents an error and is unable to boot into the default kernel, it is often easiest to try to boot into an alternative or older kernel so that you can fix the problem.
Important: Causing the GRUB boot menu to display
If you set the timeout
directive in grub.conf
to 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, and GRUB will present you with the GRUB menu.
Alternatively, use the boot media you created earlier to boot the system.