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

  1. Edit /etc/default/grub:
sudo nano /etc/default/grub
  1. Change timeout or default entry:
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
  1. Regenerate config:
sudo update-grub
  1. On RHEL:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Tips

  • GRUB_CMDLINE_LINUX_DEFAULT adds kernel parameters.
  • Use GRUB_DISABLE_RECOVERY=true to hide recovery entries.
  • Back up the original grub config before major changes.

Common issues

  • Forgetting update-grub means changes do not take effect.
  • Incorrect config can prevent booting; keep a live USB handy.