Product SiteDocumentation Site

E.7. GRUB Menu Configuration File

The configuration file (/boot/grub2/grub.cfg), 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.6, “GRUB Commands” can be used, as well as some special commands that are only available in the configuration file. Changes to grub.cfg are enacted by editing etc/default/grub and files in the etc/grub.d directory, particularly 10_linux and 40_custom, and then running the following command with root privileges:
grub2-mkconfig --output=/boot/grub2/grub.cfg

E.7.1. Configuration File Structure

The GRUB menu interface configuration file is /boot/grub2/grub.cfg.The commands to set the global preferences for the menu interface are placed at the top of the 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 Fedora:
menuentry 'Fedora Linux, with Linux 3.1.0-0.rc6.git0.3.fc16.x86_64'
set root='(hd0,1)'
linux /vmlinuz- ro root=UUID=04a07c13-e6bf-6d5a-b207-002689545705 rhgb quiet
initrd /initramfs-3.1.0-0.rc6.git0.3.fc16.x86_64.img
Configuring a GRUB menu configuration file to boot multiple operating systems is beyond the scope of this chapter. Consult Section E.9, “Additional Resources” for a list of additional resources.