Grub Boot

Asked by Luiz Alberto Medaets on 2010-04-08

I have an 10 years old notebook (500MHz Pentium, 256M memory, 6G HD) that I use as a netbook at the beach house. The PS2 device is damaged so I use an external USB mouse and keyboard that are not recognized by BIOS, that is, until Xubuntu is loaded, I have no mouse and / or keyboard.
During last boot the battery was discharged and it fail to boot. Now every time I tried to boot the Grub2 menu appears and waits for me to hit a kernel option to boot with. The problem is that I can't, as my USB keyboard at this point doesn't work.
I booted with the Ubuntu CD and edited /boot/grub/grubenv and set recordfail=1 to recordfail=0 and it worked, it booted.
Question:
- Is there a way to disable the Grub2 menu so it will never be prompted again and always boot from a specific kernel? I guess I have to edit a file from /etc/grub.d and run update-grub. But what file and what parameter to change?
Regards,
Luiz

Question information

Language:
English Edit question
Status:
Solved
For:
Bootloader Manager Edit question
Assignee:
No assignee Edit question
Solved by:
sebikul
Solved:
2010-04-11
Last query:
2010-04-11
Last reply:
2010-04-11
Best sebikul (sebikul) said : #1

It's easy to get it back, just edit /etc/default/grub and comment out GRUB_HIDDEN_TIMEOUT

$ sudo nano /etc/default/grub

Make your timeout line look like this...

#GRUB_HIDDEN_TIMEOUT=3
GRUB_TIMEOUT=XXX <---Make sure you put in a timeout value here.

Save the file and exit, then run...

$ sudo update-grub

Thanks for the tip sebikul, but the solution you suggest isn't what I was looking for. In fact, when you put a #on #GRUB_HIDDEN_TIMEOUT=0, the menu is always shown with a timeout specified on GRUB_TIMEOUT=XX.
When you have a Boot fail recordfail=1 and timeout is set to -1. When timeouut=-1, the countdown is stopped and the menu appears and waits for me to hit a kernel option to boot with.
I have changed the /etc/grub.d/00_header from:

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

to:
if [ \${recordfail} = 1 ]; then
  set timeout=10
else
  set timeout=${GRUB_TIMEOUT}
fi

Then I run the sudo update-grub to update the /boot/grub/grub.cfg. End of problem.

Thanks sebikul, that solved my question.