About the GRUB 2 Bootloader

Oracle Linux includes version 2 of the GRand Unified Bootloader (GRUB 2), which loads the operating system onto a system at boot time.

In addition to Oracle Linux, GRUB 2 can load and chain-load many proprietary operating systems. GRUB 2 understands the formats of many different file systems and kernel executable files. GRUB 2 requires the full path to the kernel and initramfs relative to the boot or root device. You can configure this information by using the GRUB 2 menu or by entering it on the GRUB 2 command line.

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

The generated GRUB 2 files are read during system boot from /boot. The main GRUB 2 configuration file is available at /boot/grub2/grub.cfg. On UEFI-based systems, an initial configuration file at /boot/efi/EFI/redhat/grub.cfg is used to help direct GRUB 2 to the correct device and location of the main GRUB2 configuration file. Each kernel version's boot parameters are stored in independent configuration files in /boot/loader/entries. Each kernel configuration is stored with the file name machine_id-kernel_version.el8.arch.conf.

Note:

Don't edit the GRUB 2 configuration file in /boot directly.

The default menu entry is set by the value of the GRUB_DEFAULT parameter in /etc/default/grub. If GRUB_DEFAULT is set to saved, you can use the grub2-set-default and grub2-reboot commands to specify the default entry. The command grub2-set-default sets the default entry for all reboots, while 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.

The preferred method for updating GRUB 2 boot loader configuration on Oracle Linux is to use the grubby command to control and manage all boot requirements. This tool offers the benefit of being scriptable and can abstract bootloader configuration from the user. You run the grubby command from the command line on a booted instance of Oracle Linux. See Using grubby to Manage Kernels for more information.

If you need to change some parameters in the configuration at boot time, you can temporarily change kernel boot parameters in the GRUB 2 boot menu. See Changing Kernel Boot Parameters Before Booting.

For more information about using, configuring, and customizing GRUB 2, see the GNU GRUB Manual, which is also installed as /usr/share/doc/grub2-tools-2.00/grub.html.