Updated: 28 September 2026 · Applies to: GRUB 2.06 and 2.12 with Boot Loader Specification entries on AlmaLinux and Rocky Linux 9 and 10 and RHEL 9 and 10; GRUB on Ubuntu 24.04 and 26.04 and Debian 13

The GRUB menu that starts your server is built from several files. On CentOS 7 and older releases the menu entries lived inside /boot/grub2/grub.cfg. On AlmaLinux, Rocky Linux and RHEL 9 and 10, each kernel has its own small file instead (Boot Loader Specification, BLS), and grub.cfg only reads them. The details below come from a real AlmaLinux 9 server.

The files and what they do

  • /boot/grub2/grub.cfg: the menu GRUB reads at boot. It starts with "DO NOT EDIT THIS FILE": it is generated by grub2-mkconfig. This path is used on both BIOS and UEFI systems.
  • /etc/default/grub: the settings used when grub.cfg is generated, such as GRUB_TIMEOUT=5, GRUB_DEFAULT=saved, GRUB_CMDLINE_LINUX (default kernel parameters) and GRUB_ENABLE_BLSCFG=true.
  • /etc/grub.d/: numbered scripts that write the parts of grub.cfg in order, for example 00_header and 10_linux. Your own entries go in 40_custom.
  • /boot/loader/entries/*.conf: one file per installed kernel, plus a rescue entry. Each has a title, the linux kernel, the initrd and the options (kernel parameters). New kernels add a file automatically.
  • /boot/grub2/grubenv: small saved state, such as saved_entry (the default kernel). Read it with grub2-editenv list.

Common tasks

  1. List the boot entries and see the default:
    grubby --info=ALL | grep -E '^(index|title)'
    grubby --default-kernel
  2. Choose another default kernel:
    grubby --set-default /boot/vmlinuz-VERSION
  3. Change kernel parameters for all entries (new kernels inherit them):
    grubby --update-kernel=ALL --args="consoleblank=0"
  4. Change the menu timeout or other settings: edit /etc/default/grub, then regenerate:
    grub2-mkconfig -o /boot/grub2/grub.cfg

Ubuntu and Debian

The menu is /boot/grub/grub.cfg, built from /etc/default/grub and /etc/grub.d/ as above, but the kernels are written into grub.cfg itself (no BLS entries). After changing /etc/default/grub, run update-grub.

Common problems

  • Your edits to grub.cfg disappeared: the file is regenerated by kernel updates. Put changes in /etc/default/grub, /etc/grub.d/40_custom or use grubby.
  • The wrong kernel boots by default: check grub2-editenv list and set the default with grubby --set-default.
  • To change parameters for one boot only, edit the entry in the menu: see how to change GRUB kernel parameters before booting.

Official documentation: Configuring kernel command-line parameters (Red Hat) and GNU GRUB manual.

Ucartz services for this topic

Was this answer helpful? 0 Users Found This Useful (1 Votes)