4

I'm am trying to enable the boot timeout selection in grub2 on Ubuntu 9.10.

I modified /etc/default/grub:

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"
GRUB_CMDLINE_LINUX=""

and ran update-grub, but I still do not have a boot timeout counter. What else can you do to enable this?

cmcginty
  • 3,269

3 Answers3

5

Answer taken from http://ubuntuforums.org/showthread.php?t=1373965

at the end of your /etc/grub.d/00_header file, comment out the if condition except for the regular set timeout line like this:

#if [ \${recordfail} = 1 ]; then
#  set timeout=-1
#else
  set timeout=${GRUB_TIMEOUT}
#fi

run update-grub to regenerate the grub.cfg with the new settings:

sudo update-grub

reboot, now it should always boot the default option after the timeout, even if the previous boot failed.

Yariv
  • 256
4

The problem was related to a the grub env value: recordfail. I was able to resolve with the following command:

grub-editenv /boot/grub/grubenv unset recordfail

Another option that will guarantee the timeout will always work:

rm /boot/grub/grubenv

If you don't do this, grub might re-write the recordfail value. I needed this for an embedded system.

cmcginty
  • 3,269
1

A bit less invasive option to get a very similar result to previous answers is to add the following line to your /etc/default/grub:

GRUB_RECORDFAIL_TIMEOUT=5

...or however many seconds you want. It might be dangerous to set it to 0, I'm not sure.

Carolus
  • 329
  • 4
  • 8