Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
Last active June 24, 2018 13:30
Show Gist options
  • Save magnetikonline/32b984c09a7cf06c0164 to your computer and use it in GitHub Desktop.
Save magnetikonline/32b984c09a7cf06c0164 to your computer and use it in GitHub Desktop.
Cancel Ubuntu Grub2 menu after failed boot/shutdown.

Cancel Ubuntu Grub2 menu after failed boot/shutdown

Use the following values in /etc/default/grub:

GRUB_HIDDEN_TIMEOUT=2
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_RECORDFAIL_TIMEOUT=2

Then run: sudo update-grub to commit settings.

Notes

  • GRUB_HIDDEN_TIMEOUT will wait X number of seconds for a key to be pressed before displaying the menu. After which menu will be shown for GRUB_TIMEOUT seconds.
  • Using GRUB_HIDDEN_TIMEOUT_QUIET to avoid the on-screen count down of the Grub menu.
  • Setting GRUB_TIMEOUT to zero means to see the Grub menu with GRUB_HIDDEN_TIMEOUT - simply hold down Shift (or similar key) on bootup to access the Grub menu.
  • GRUB_RECORDFAIL_TIMEOUT ensures the Grub menu will display on countdown, rather than the default of "wait for a keypress" after failed boot/shutdown. Handy for headless/keyboard-less systems.
  • Note: Recent versions of Ubuntu/Grub will emit a Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported. by default when rebuilding Grub config. The settings above will avoid this issue.

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment