How to get to the GRUB2 menu

Asked by komputes

I am using Karmic, where GRUB2 has changed the menu config file to /boot/grub/grub.cfg. With this change there has been new syntax added as well. I was wondering if someone could explain the following to me.

1) How do I display the GRUB menu for X number of seconds at each boot? What is the actual syntax? I was suggested to run "sudo /usr/sbin/grub-mkconfig" but this only makes a grub config file that tried to auto detect and output a grub.cfg that is erroneous, as explained in Bug #413345

2) What does this line mean, will pressing shift during boot show the menu now? What is the value of -1?

### BEGIN /etc/grub.d/30_os-prober ###
if keystatus; then
  if keystatus --shift; then
    set timeout=-1
  else
    set timeout=0
  fi
else
  if sleep --interruptible 3 ; then
    set timeout=0
  fi
fi
### END /etc/grub.d/30_os-prober ###

Question information

Language:
English Edit question
Status:
Solved
For:
grub Edit question
Assignee:
No assignee Edit question
Solved by:
komputes
Solved:
Last query:
Last reply:
Revision history for this message
Daniel Hollocher (chogydan) said :
#1

First off, you shouldn't edit /boot/grub/grub/cfg. You should be looking in /etc/default/grub

You can find allot of info here: https://wiki.ubuntu.com/Grub2

Revision history for this message
komputes (komputes) said :
#2

I don't see where I would enter the correct UUID or device name in /etc/default/grub.

Revision history for this message
Daniel Hollocher (chogydan) said :
#3

if you want to edit the UUID, then it looks like you will have to edit /boot/grub/grub.cfg or maybe you can make a custom script.

In theory, you shouldn't have to add UUIDs as the scripts should detect them for you. (maybe?)

gl

Revision history for this message
komputes (komputes) said :
#4

In theory, UUIDs should be detected correctly, I agree.

Yes in karmic, they are not. grub.cfg generates erroneous entries, as explained in Bug #413345

Revision history for this message
Launchpad Janitor (janitor) said :
#5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
komputes (komputes) said :
#6

-

Revision history for this message
Launchpad Janitor (janitor) said :
#7

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
komputes (komputes) said :
#8

Shift seems to work, but do not press it when the computer is starting. There is a few seconds between the BIOS splash and "GRUB Loading..." where the shift key will work and bring up the menu.

I am still not sure of the method to show the menu at every boot.

Revision history for this message
Daniel Hollocher (chogydan) said :
#9

have you edited /etc/default/grub do that it is set to show the menu?

Revision history for this message
komputes (komputes) said :
#10

Ok, it now shows the menu at every boot. This is what I had to do to make show the menu at every boot:

I edited /etc/default/grub

$ sudo nano /etc/default/grub

and I commented out the following line by starting the line with a hash/number symbol (#):

# GRUB_HIDDEN_TIMEOUT=0

then I had to run the following command to update the current grub.cfg

$ sudo update-grub2

Revision history for this message
kedmanee (kedmanee) said :
#11

I suspect setting "GRUB_HIDDEN_TIMEOUT" to zero is a victim of the fight for a faster bootup.

At a single boot system the user have no chance to get the menu.
I've learned this lesson on my Lucid-alpha system.
The default setting should have some seconds.