How to configure GRUB bootloader settings
· Category: Linux
Short answer
GRUB is the default bootloader for many Linux distributions. Edit /etc/default/grub and regenerate the config to change boot behavior.
Steps
- Edit
/etc/default/grub:
sudo nano /etc/default/grub
- Change timeout or default entry:
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
- Regenerate config:
sudo update-grub
- On RHEL:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Tips
GRUB_CMDLINE_LINUX_DEFAULTadds kernel parameters.- Use
GRUB_DISABLE_RECOVERY=trueto hide recovery entries. - Back up the original grub config before major changes.
Common issues
- Forgetting
update-grubmeans changes do not take effect. - Incorrect config can prevent booting; keep a live USB handy.