Product SiteDocumentation Site

20.6. ブートローダの確認

When you install a kernel using rpm, the kernel package creates an entry in the boot loader configuration file for that new kernel. However, rpm does not configure the new kernel to boot as the default kernel. You must do this manually when installing a new kernel with rpm.
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.
表20.1 Boot loaders by architecture
Architecture Boot Loader Refer to
x86 GRUB 「Configuring the GRUB Boot Loader」
AMD AMD64 or Intel 64 GRUB 「Configuring the GRUB Boot Loader」
IBM eServer System i OS/400 「Configuring the OS/400 Boot Loader」
IBM eServer System p YABOOT 「Configuring the YABOOT Boot Loader」
IBM System z z/IPL

20.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.
例20.1 /boot/grub/grub.conf
# grub.conf generated by anaconda
[comments omitted]

title Fedora (
        root (hd0,0)
        kernel /boot/vmlinuz- ro root=UUID=e8148266-4a56-4f4d-b6df-9eafea4586b2 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
        initrd /boot/initramfs-
title Fedora (
        root (hd0,0)
        kernel /boot/vmlinuz- ro root=UUID=e8148266-4a56-4f4d-b6df-9eafea4586b2 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
        initrd /boot/initramfs-

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 例20.1「/boot/grub/grub.conf」, therefore the initrd /initramfs- line in the first kernel stanza means that the initramfs image is actually located at /boot/initramfs- when the root file system is mounted, and likewise for the kernel path (for example: kernel /vmlinuz- 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
Dracut is a new utility available in Fedora 16, and much-improved over mkinitrd. For information on using Dracut, refer to 「初期RAMディスクイメージの確認」.
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 手順20.1「初期RAMディスクイメージの確認」 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 titled stanzas representing bootable kernels starting with 0. In 例20.1「/boot/grub/grub.conf」, the line default=1 indicates that GRUB will boot, by default, the second kernel entry, i.e. title Fedora (
In 例20.1「/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.

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.