Prevent grub screen after failed boot

After the upgrade to Ubuntu 11.04 I noticed that my HTPC box wouldn’t automatically reboot after a hard reset. I always had to connect a keyboard and press the enter button to resume booting. Kind of an unwanted situation for a box that stands in the living room. So I went through the grub.cfg file to see what needs to be changed. Here is the Ubuntu howto:

First open the /etc/grub.d/header file (you need to use sudo, so you can save it) and look for the following lines:

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

Then change the line "set timeout=-1" to some other, positive value, like: "set timeout=10". The result should look like this:

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

Now the grub.cfg template is updated, the only thing left is to execute an update of the real grub.cfg.

sudo update-grub2

This way the modifications remain in the system, even when new kernels are updated.

Leave a Reply