grub.cfg is the main configuration file for the GRUB2 (GRand Unified Bootloader version 2) bootloader. It is located in the /boot/grub2/ directory on Linux systems. Here are the key points about grub.cfg:
-
Purpose: It contains the boot menu configuration, which defines how GRUB2 presents available operating systems and kernels during the boot process. It determines what options users see when they start their computer.
-
Generated File: The
grub.cfgfile is not manually edited. Instead, it is automatically generated by running thegrub2-mkconfigcommand, which combines settings from/etc/default/gruband scripts in/etc/grub.d/. -
Boot Entries: The file includes entries for each operating system or kernel installed on the system, along with parameters that control how they are loaded. This can include options for kernel parameters, timeout settings, and more.
-
Static Nature: Once generated,
grub.cfgis a static file. Any changes to the boot configuration (like modifying/etc/default/grub) require regenerating this file to take effect. -
Execution: During the boot process, GRUB2 reads
grub.cfgto display the boot menu and execute the selected entry, loading the appropriate operating system or kernel.
In summary, grub.cfg is a crucial component of the GRUB2 bootloader, managing how the system boots and what options are available to the user.
