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 bygrub2-mkconfig. This path is used on both BIOS and UEFI systems./etc/default/grub: the settings used when grub.cfg is generated, such asGRUB_TIMEOUT=5,GRUB_DEFAULT=saved,GRUB_CMDLINE_LINUX(default kernel parameters) andGRUB_ENABLE_BLSCFG=true./etc/grub.d/: numbered scripts that write the parts of grub.cfg in order, for example00_headerand10_linux. Your own entries go in40_custom./boot/loader/entries/*.conf: one file per installed kernel, plus a rescue entry. Each has atitle, thelinuxkernel, theinitrdand theoptions(kernel parameters). New kernels add a file automatically./boot/grub2/grubenv: small saved state, such assaved_entry(the default kernel). Read it withgrub2-editenv list.
Common tasks
- List the boot entries and see the default:
grubby --info=ALL | grep -E '^(index|title)' grubby --default-kernel
- Choose another default kernel:
grubby --set-default /boot/vmlinuz-VERSION
- Change kernel parameters for all entries (new kernels inherit them):
grubby --update-kernel=ALL --args="consoleblank=0"
- 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_customor use grubby. - The wrong kernel boots by default: check
grub2-editenv listand set the default withgrubby --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.