3.3.1 Customizing GRUB 2 Configuration

You can manage GRUB 2 configuration by using the GRUB 2 menu or by using the command line.


Do not edit the GRUB 2 configuration file directly. On BIOS-based systems, the configuration file is /boot/grub2/grub.cfg. On UEFI-based systems, the configuration file is /boot/efi/EFI/redhat/grub.cfg.

The grub2-mkconfig command generates the configuration file by using the template scripts in the /etc/grub.d file and menu configuration settings are taken from the /etc/default/grub configuration file.

The default menu entry is determined by the value of the GRUB_DEFAULT parameter in /etc/default/grub. The value saved allows you to use the grub2-set-default and grub2-reboot commands to specify the default entry. grub2-set-default sets the default entry for all subsequent reboots and grub2-reboot sets the default entry for the next reboot only.

If you specify a numeric value as the value of GRUB_DEFAULT or as an argument to either grub2-reboot or grub2-set-default, GRUB 2 counts the menu entries in the configuration file starting at 0 for the first entry.