Where Is the GRUB Bootloader Config on Linux?
On Linux, GRUB settings are edited in /etc/default/grub and the generated boot menu is /boot/grub/grub.cfg.
Last updated
The admin editable file is /etc/default/grub. It holds variables such as timeout, default entry and kernel options used when the config is generated.
The active boot menu is /boot/grub/grub.cfg on most BIOS and UEFI installs with GRUB 2. It is produced by grub-mkconfig from /etc/default/grub plus scripts in /etc/grub.d, so direct edits are overwritten.
Where GRUB stores this, by platform
/etc/default/grub
Edit as root, then apply with sudo update-grub on Debian and Ubuntu or sudo grub-mkconfig -o /boot/grub/grub.cfg on Arch and similar distros. File must stay valid POSIX shell syntax with quoted values when spaces are present. Custom entries belong in /etc/grub.d/40_custom rather than here.
/boot/grub/grub.cfg
Generated output, do not edit by hand. Path can differ by distro, with Fedora and RHEL family using /boot/grub2/grub.cfg and UEFI setups keeping EFI binaries under /boot/efi. Always regenerate after kernel, timeout or default changes and keep a backup before major edits.
Frequently asked questions
How do I safely change GRUB timeout or default OS?
Open /etc/default/grub as root, adjust GRUB_TIMEOUT and GRUB_DEFAULT, save, then run sudo update-grub or the matching grub-mkconfig command for the distro. Reboot to test and keep a live USB nearby when changing boot order on dual boot systems.
Why did my edit to grub.cfg disappear?
Package or kernel updates rerun grub-mkconfig and overwrite /boot/grub/grub.cfg. Place persistent tweaks in /etc/default/grub or /etc/grub.d scripts, plus /boot/grub/custom.cfg for manual entries that should survive regeneration.
Notice an outdated path? Let us know.