E.8. GRUB Menu Configuration File
The configuration file (
/boot/grub/grub.confon BIOS systems and
/boot/efi/EFI/redhat/grub.confon UEFI systems), which is used to create the list of operating systems to boot in GRUB's menu interface, essentially allows the user to select a pre-set group of commands to execute. The commands given in Section E.7, “GRUB Commands” can be used, as well as some special commands that are only available in the configuration file.
E.8.1. Configuration File Structure
The commands to set the global preferences for the menu interface are placed at the top of the GRUB configuration file, followed by stanzas for each operating kernel or operating system listed in the menu.
The following is a very basic GRUB menu configuration file designed to boot either Red Hat Enterprise Linux or Microsoft Windows:
default=0 timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (184.108.40.206.el6.i686) root (hd0,0) kernel /boot/vmlinuz-220.127.116.11.el6.i686 ro root=LABEL=/1 rhgb quiet initrd /boot/initrd-18.104.22.168.el6.i686.img # section to load Windows title Windows rootnoverify (hd0,0) chainloader +1
This file configures GRUB to build a menu with Red Hat Enterprise Linux as the default operating system and sets it to autoboot after 10 seconds. Two sections are given, one for each operating system entry, with commands specific to the system disk partition table.
Note that the default is specified as an integer. This refers to the first
titleline in the GRUB configuration file. For the
Windowssection to be set as the default in the previous example, change the
Configuring a GRUB menu configuration file to boot multiple operating systems is beyond the scope of this chapter. Consult Section E.10, “Additional Resources” for a list of additional resources.