HowTo: Stop GRUB preventing auto-start of the OS after a previous boot failure
The GRUB boot menu by default will generally show its menu for about ten seconds before automatically booting the OS, but if something goes wrong, or an over-zealous party interrupts the boot process because he thought it had hung, the OS will tell GRUB that.
Now that’s all well and good, but GRUB’s default action in such an instance is to abort the automatic timeout and stay at the GRUB boot menu waiting for a manual action, such as entering recovery mode.
On systems that are unattended or without keyboards, this proves to be very annoying and generally you’d like the OS to boot up anyway despite the reported failure.
So here’s how you can fix it.
- First up, boot into your system and open a terminal.
- Now type in:
$ sudo nano /etc/default/grub
…and hit Enter. The Nano text editor will appear. - In the file shown, scroll right to the bottom and add the following lines:
# Timeout for a previous failed startup. GRUB_RECORDFAIL_TIMEOUT=10
- Now press CTRL+X, then “Y” and then Enter to save your changes.
- Now update your GRUB configuration with the new option we added with:
$ sudo update-grub
- Pat yourself on the back. You’re done.
So what did we just do? Simple, we added a new configuration item that tells GRUB that in the event of a reported previous failure, display the GRUB menu as before, but this time apply a ten second delay before booting the default menu item anyway.
The ten seconds will give you time to interrupt it and go to recovery if necessary, but there’s no reason why you wouldn’t set this to a much lower time if you wanted to, such as 2 seconds or less.
Leave a Reply