1

How can I get GRUB to boot straight into Ubuntu without showing a menu for 30 seconds?

I installed a brand new installation of Ubuntu 18.04.3 on a brand new machine today.

The manufacturers had installed a test installation of Windows but I told Ubuntu installer to erase it and overwrite with Ubuntu.

Now I'm finding that the GRUB menu appears and waits 30 seconds before defaulting to Ubuntu (the first option). It shows three options: 'Ubuntu,' 'Advanced options for Ubuntu' (which leads to a submenu with a choice of kernel versions), and lastly an option which causes the system to reset and bring up the BIOS settings. This isn't great as this machine is supposed to be standalone and this is making for a slow reboot time.

When I look in /etc/default/grub, I see that GRUB_TIMEOUT is already set to 0 and GRUB_TIMEOUT_STYLE is already set to "hidden", which is odd as the GRUB menu is staying up for 30 seconds on each boot.

Nevertheless, I've tried adding: GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true (and running sudo update-grub) which made no difference. The grub menu still stays up for 30 seconds on each boot. I've tried it with just the GRUB_HIDDEN_TIMEOUT options active and the GRUB_TIMEOUT options commented; and with just the GRUB_TIMEOUT options active and the GRUB_HIDDEN_TIMEOUT options commented; none of that makes a difference.

I've tried adding: GRUB_DISABLE_OS_PROBER=true (and running sudo update-grub) which made no difference. Still get a grub menu for 30 seconds.

I've tried removing the x-bit from /etc/grub.d/30_os-prober, which still made no difference.

I've now tried running boot-repair from a live USB, which added several new options to the menu (each with names which are strings of letters with .efi endings). The menu is still shown for 30 seconds.

Is there anything else I can try to get GRUB to skip the menu and boot straight into Ubuntu?* Short of a reinstall?

Thanks in advance!

====================

EDIT: I have isolated the problem. In /etc/grub.d/00_header there is:

if [ "$recordfail_broken" = 1 ]; then
  cat << EOF
if [ \$grub_platform = efi ]; then
  set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}
  if [ x\$feature_timeout_style = xy ] ; then
    set timeout_style=menu
  fi
fi
EOF

...which results in these lines being in /boot/grub/grub.cfg...

if [ $grub_platform = efi ]; then
  set timeout=30
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
  fi
fi

So even though there is no "recordfail" set in my grub environment (I have checked), apparently GRUB is declaring the recordfail system to be broken and is therefore defaulting to the recordfail default timeout of 30 seconds.

I have changed GRUB_RECORDFAIL_TIMOUT to 0 and now I get the faster boot time I wanted. However, now I obviously have no access to the boot menu if there are ever any problems booting.

It seems this happening is because the /boot dir isn't writeable because it's on an LVM partition. It's a known bug (here). But why would this happen on a brand new install...?

0

Many times when GRUB_TIMEOUT is set to zero it is overriden. Try this instead:

GRUB_TIMEOUT=0.1
  • Thanks for the suggestion - unfortunately however it made no difference. It's like the grub updater is ignoring everything in there – user983415 Aug 9 at 14:42
  • After sudo update-grub is run you can open /etc/boot/grub.cfg to verify the changes took effect. – WinEunuuchs2Unix Aug 9 at 21:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.