Linux – Anyway to get GRUB failsafe to timeout

grublinuxUbuntu

I've got a bunch of headless servers installed in random (remote) locations all running Ubuntu 11.04. Sometimes the boxes go down and never come back up, eventually someone goes out to check on them to find them sitting at a GRUB screen.

On a normal boot, the machines scream through GRUB with no issue, but it seems like there is some sort of "failsafe" built in that if the machine doesn't boot up properly, the next time the box comes up, it stops at GRUB.

I realize this is for my safety, but due to how the machines are setup, I'd prefer it didn't happen (or at least timeout after a minute or two and try to boot again). Is there anyways to disable this feature?

Best Answer

Ubuntu has a "cute" (read: annoying) feature where it records a boot failure and sets a grub timeout of -1, disabling auto-boot. You aren't the only one that doesn't like it, see here.

You should be able to work around this by editing /etc/grub.d/00_header, find the section that reads..

if [ "\${recordfail}" = 1 ]; then
  set timeout=-1

..and change it to something sane, like..

if [ "\${recordfail}" = 1 ]; then
  set timeout=10

..then run update-grub.

This file might get reset to default on you during an upgrade of the grub2 package (or the OS), so be careful of that.

Related Topic