TECH / Servers & Websites 2 min read

How to Change the GRUB Boot Menu Timeout in Linux

Antonio NEMCD Author
Published Jun 9, 2015 · 2 min

By default, Linux pauses at the GRUB2 boot menu for 5 seconds on every startup. That menu is handy when you need to pick an older kernel or enter recovery mode, but waiting five extra seconds on every reboot of a server or desktop quickly gets old.

GRUB boot menu on Debian Linux

Changing the countdown takes one line in the GRUB config and one regeneration command – here is how it works on Debian, Ubuntu, and RHEL-based distributions.

Step 1. Edit GRUB_TIMEOUT in /etc/default/grub

Open the GRUB configuration file with root privileges:

sudo nano /etc/default/grub

Find GRUB_TIMEOUT and set it to the number of seconds you want. On servers, 1 second is a sweet spot – fast reboots while still leaving a brief window to tap an arrow key over KVM if needed:

GRUB_TIMEOUT=1
  • Set to 0: boots straight into the default kernel with no delay (hold Shift or tap Esc during boot to bring the menu back).
  • Set to -1: waits indefinitely for manual input – fine for a local test bench, risky on a remote server.
  • Menu hidden on Ubuntu: if Ubuntu skips displaying the menu altogether, change GRUB_TIMEOUT_STYLE=hidden to GRUB_TIMEOUT_STYLE=menu.

Step 2. Apply the GRUB Configuration

Saving the file alone does nothing until you regenerate the active GRUB config:

  • Debian, Ubuntu, Linux Mint:
sudo update-grub
  • Rocky Linux, AlmaLinux, CentOS, Fedora:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Reboot with sudo reboot and verify that the GRUB menu now honors your new timeout.

Related posts:

Leave a Comment