How can I force Ubuntu to boot on a stuck boot menu?

As of Ubuntu 12.04, a more straightforward, but nevertheless undocumented, solution is to use /etc/default/grub to override the recordfail timeout:

GRUB_TIMEOUT=10
GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT

Then run sudo update-grub to apply the changes.


The fact that such option is completely undocumented is just too bad.

Actually, the support for GRUB_RECORDFAIL_TIMEOUT was added in the middle of the 12.04 cycle, starting from version 1.99-21ubuntu3.3:

  grub2 (1.99-21ubuntu3.3) precise-proposed; urgency=low

[ Ben Howard ]
* Parameterization of recordfail setting. This allows users to define the
  default time out of GRUB when recordfail has been set. The curren
  setting causes hangs on headless and appliances where access to the
  console is limited or prohibited.  (LP: #669481)  [1]

-- Louis Bouchard <[email protected]>  Tue, 21 Aug 2012 10:51:58 +0200

More detailed information from LaunchPad.


The answer to this one can be found in the grub file /etc/grub.d/00_header

make_timeout ()
{
    cat << EOF
if [ "\${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=${2}
fi
EOF
}

Setting the timeout value to -1 will stop the count down. Change the value to a value > 0 i.e. set timeout=10

this section of the file would look like

make_timeout ()
{
    cat << EOF
if [ "\${recordfail}" = 1 ]; then
  set timeout=10
else
  set timeout=${2}
fi
EOF
}

Then run

sudo update-grub2