brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: GRUB_TIMEOUT_STYLE=hidden keeps the GRUB menu out of sight until you need it

Linux
~/tips/tip-grub-timeout-style-hidden

GRUB_TIMEOUT_STYLE=hidden

Hides the GRUB menu behind a short timeout, and the menu still appears when you press ESC or hold Shift.

A boot menu I never use does not need to flash by at every start. GRUB can stay hidden and still be one keypress away.

In /etc/default/grub:

GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=2

With hidden or countdown, GRUB waits for the timeout before it shows the menu. If you press ESC or F4, or hold Shift, during that time, it shows the menu and waits for input. If the timeout runs out first, it boots the default entry. The countdown style does the same and prints a one-line indication of the remaining time.

The unset or menu style behaves differently: GRUB shows the menu first, then waits for GRUB_TIMEOUT, and a key press stops the timer. The default timeout is 5 seconds.

Two more values of GRUB_TIMEOUT are documented. 0 boots immediately without showing the menu, and -1 waits indefinitely.

Then regenerate the config, as the manual describes:

sudo grub-mkconfig -o /boot/grub/grub.cfg

The caveats: the output path differs per distribution. The file is read as shell, so it must be plain KEY=value lines, with quotes around a value that has spaces. And with a hidden menu, a machine without a keyboard cannot show it. For a remote server I’d keep a longer timeout, and I’d test the key on a spare machine first.

Further reading: GRUB manual: simple configuration, GRUB manual: invoking grub-mkconfig

Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more

More Linux tips a2query -m rewrite renice -n 10 -p 4242 cat config.yml | xsel -ib xvfb-run -a your-program --some-flag dpkg --get-selections > packages.txt All Linux tips (261) All topics

Link