Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running Ubuntu 12.04.

I cannot for the life of me get the grub menu (with options) to go away.

I would like it to auto-boot into the first option. I've edited /etc/default/grub so that it looks like the following:

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

After this, I ran sudo update-grub. Then I realized that I had grub 2, so I ran sudo update-grub2 (both make it look like they create the grub.cfg file successfully.

I restart my computer and it goes back to the grub menu and just sits there until I make a choice. This is not desirable if the power goes out... :-)

I also tried reinstalling grub using sudo grub-install /dev/sda - also unsuccessful

share|improve this question
    
Do you by any chance have another partition that you installed Ubuntu to after setting up the current partition that you now wish to boot into automatically? – fabricator4 Oct 18 '12 at 2:48
    
I'm not sure what you mean, I'm kind of new to linux. I did install over a previous Ubuntu installation, but I did not upgrade. Clean install. I may have mucked something up partition-wise... that's possible, any ideas on fixing it? – Eric Oct 18 '12 at 4:20
    
sudo update-grub and sudo update-grub2 runs the same command. So, don't worry about that part. – saji89 Oct 18 '12 at 6:01
    
Please you post the output of cat /boot/grub/grub.cfg via pastebin and share the link here. This is to see the actual grub.cfg generated. – saji89 Oct 18 '12 at 6:03
    
Here's the pastebin: pastebin.com/xxe2rLhg of grub.cfg. Thanks for all your help! – Eric Oct 18 '12 at 13:39

As other answers point out, you may be a victim of the recordfail situation. Editing /boot/grub/grub.cfg manually should be out of the question as is automatically generated. Another suggestion seen around is to edit the /etc/grub.d/00_header but then it could prompt for user intervention on updates.

The easiest solution is to define the undocumented GRUB_RECORDFAIL_TIMEOUT variable in /etc/default/grub. For example:

GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=5
GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT

Edit

See this answer for more details.

share|improve this answer
    
Thank you very much, this is exactly what I was looking for! – Avio Oct 17 '13 at 11:59

Use:

grub-editenv create

This will clear grub environment file and should boot clearly the next time.

share|improve this answer
    
+1 for elegant solution – Coc Jan 10 '14 at 13:27

I had the problem that the grub menu appeared always after I used the AUFS (unionfs) to put the root filesystem readonly. I had phisically to hit the enter key at the server after every boot. I followed the instructions here : disable grub 2 menu. Since, I had no problems at all.

Edit the /boot/grub/grub.cfg and change:

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

To

if [ ${recordfail} = 1 ]; then
  set timeout=1
else
  set timeout=10
fi
share|improve this answer
    
The before and after in your solution are exactly the same. – RawwrBag Dec 18 '14 at 1:38
    
set timeout=-1 is not the same as set timeout=1. The former is "wait forever", and the latter is "wait for one second". – Jeff McJunkin Jul 22 '15 at 18:36

change the GRUB_TIMEOUT=10 to zero

This is my Configuration file:

GRUB_DEFAULT="Ubuntu, with Linux 3.2.0-30-generic-pae"
#GRUB_HIDDEN_TIMEOUT=10
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""

First, write the name of the OS that you want to boot to directly. Mine is Ubuntu. So you will write it as in the GRUB_DEFAULT="Ubuntu, with Linux x.x.x-xx-generic-pae"

then I used 1 second in the GRUB_TIMEOUT= to give me 1 second before selecting the default OS (if I need to boot to another OS for example Xubuntu)

as for GRUB_CMDLINE_LINUX_DEFAULT="" if you remove quite splash it will show you texts instead of the Ubuntu logo during the booting process (I like it this way :P )


There is another solution:

There is a program called boot-repair which helps in configuring with a GUI.

enter image description here

enter image description here

as you can see from the image. there is a box called Unhide boot menu. Just uncheck the box and press appy. You can access this by clicking on the advanced options arrow.

to install boot repair

sudo add-apt-repository ppa:yannubuntu/boot-repair

sudo apt-get update

sudo apt-get install -y boot-repair

and then run boot-reapir either from the terminal or from the dash.


3rd solution:

ou can use an easy to use GUI app called grub-customizer to make your life a little easy. As the name suggests, you can do much more than just reordering Grub menu entries with it.

You can install it by:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

enter image description here

as you can see from the menu there is show menu option. Unhceck and see if it works

share|improve this answer
    
No change. :-/ I thought GRUB_DEFAULT was supposed to be a numeric # according to the list in the menu? Changing GRUB_TIMEOUT to 0 didn't help. – Eric Oct 18 '12 at 13:28
    
@Eric you can use 2 ways: if you know the place of your OS in the grub list you can use a number. But for me I have 4 Linux distros and 1 Windows plus the memTest and the recovery. So its hard for me to memorize their places :) just to make sure(I know you may have done it but just to make sure :P ). Did you run the grub-update after changing the values ? – Suhaib Oct 18 '12 at 20:20
    
I did run grub-update after changing the values. :-/ – Eric Oct 18 '12 at 22:38
    
I installed and used the boot-repair app you provided, it works on the first reboot. After that, the GRUB menu is back and it sits there until I press a key. Thank you for all your help, I really appreciate it. Not sure where to go from here... – Eric Oct 19 '12 at 0:23
    
@Eric ok I found a 3rd solution check it – Suhaib Oct 21 '12 at 20:25

I could solve that issue by adding the following line to /etc/default/grub

GRUB_DISABLE_OS_PROBER=true

...and then running sudo update-grub.

Explaination: The file /boot/grub/grub.cfg is generated by running update-grub using the files in /etc/grub.d and /etc/default/grub. Therefore you should not edit grub.cfg, but it can be helpful to find out why the timeout is set. Search for lines starting with set timeout= and then search for the next line starting with ### END /etc/grub.d/ .... This might give you hints which script sets the timeout. In my case the os-prober script was responsible for the timeout. It turns out that there is a 10s hardcoded timeout in /etc/grup.d/30_os-prober which is not set by GRUB_TIMEOUT. You can either disable os-prober by GRUB_DISABLE_OS_PROBER=true or edit /etc/grup.d/30_os-prober or use GRUB_OS_PROBER_SKIP_LIST to skip some of your harddisk partitions (30_os-prober is used when another OS is found somewhere). See this Q&A for details. As others pointed out another reason might be the recordfail, in this case set GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT.

share|improve this answer

GRUB_HIDDEN_TIMEOUT and GRUB_HIDDEN_TIMEOUT_QUIET options are deprecated. So comment out those.

To skip the menu and show it when only holding ESC, add:

GRUB_TIMEOUT_STYLE='countdown'
GRUB_TIMEOUT=1

Sample /etc/default/grub

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=1
GRUB_TIMEOUT_STYLE=countdown
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""

'GRUB_TIMEOUT_STYLE': If this option is set to 'countdown' or 'hidden', then, before displaying the menu, GRUB will wait for the timeout set by 'GRUB_TIMEOUT' to expire. If ESC is pressed during that time, it will display the menu and wait for input.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.