Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Question How can I get GRUB to take a different OS as the default one ? All the usual methods as explained on the ubuntu site haven't worked. The only thing I haven't tried yet is GRUB Customizer out of fear to break something.

The context I have multiple operating systems, among them two Ubuntu 11.10 distros. Two distinguish them, lets call them OS A and B. I first installed A, spent a lot of time setting it up the way I like it to be, an then I installed B as an OS with which I can fool around a bit. Until now, GRUB worked fine. The problem was, after installing B GRUB is now set to start B as default and I can't change it. I tried different things ( like editing some files to change the start order and then updated GRUB via sudo update-grub), or using Startup manager(so the proposed answers askubuntu gives me for this question don' count), but nothing helped. Generally, I can't change anything in GRUB, not even other things like how long the screen with the OSes is being displayed (I wanted it to be as short as possible, but it's still at 10 seconds). All attempts to do this were done from OS A. I haven't tried GRUB Customizer because there are a lot more entries shown there that at the boot process, so I don't know whats happening with that. I also would like to remove some entries from the GRUB menu (like different kernel version of the same OS), but in GRUB Customizer I'm afraid to tick the wrong things off.

Here is my etc/default/grub file:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

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

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
                #GRUB_INIT_TUNE="480 440 1"
share|improve this question
2  
it should work in natural way. Your default Grub=14 is not correct. See details here shantanucse.blogspot.com/2011/10/… –  shantanu Apr 10 '12 at 14:40
1  
Maybe it's a silly question, but do you run sudo update-grub after editing /etc/default/grub? Unless you do that, nothing in your config files gets put into the actual grub config (/boot/grub/grub.cfg). –  zpletan Apr 10 '12 at 14:52
    
@zpletan Yes I did that (I edited my question now, so that nobody shall be confused if or how I updated it). I know that that is a common error - the weird is just that it isn't working in spite of doing update-grub. –  user10324 Apr 13 '12 at 12:56

2 Answers 2

up vote 2 down vote accepted

Everything in your grub config looks good except the very first line: GRUB_DEFAULT=14. Do you really have 15 boot options in your Grub menu?

Your Grub timeout settings are correct if you want the menu to appear for about 1 second. Your comment about Grub taking 19 seconds is a bit strange... I would wager that perhaps Grub gets confused by the fact that there is no item 15 on your menu, takes a long time to decide what to do, and automatically picks the first option.

In any case, look for the OS you want to boot on the menu and its position. Then change the incorrect line. Keep in mind that 0 refers to the first item, 1 refers to the second item, etc.

Remember to update grub after you make the change: sudo update-grub

share|improve this answer
    
Sorry, typo: actually Grub takes me 10 seconds. Corrected now. Will do what you wrote here and will report back... –  user10324 Apr 13 '12 at 12:58
    
Actually I had 17 entries in my GRUB menu. The problem was with the 2 OSes - as explained in my question. The thing is, that in my primary OS A I could change what I want in GRUB without any effect at all. Everything had to be done in the OS B, which was last installed, to take effect. Weird. Maybe the GRUB coders should look at this type of problem with multiple OSes, beacuase it's really annoying that only the last installed OS permits changes to GRUB. –  user10324 Apr 22 '12 at 9:34

Keep in mind that it is possible that you have Grub installed in more than one location. Perhaps OS A had Grub installed to its partition and OS B installed Grub to a different location, which is now the one being used during boot. I seem to recall during some installations having the option to use a partition (e.g. sda1) instead of the drive itself (e.g. sda). Just a guess.

However, I really wanted to add that you can also use names for the default. I used to have a machine that I wanted to default to a specific kernel, and occasionally had to change the default since it was subject to getting renumbered during updates as it got pushed further down the list.

As another example of this, on the machine I am on now, there is a line in my grub that I used to use when I was playing StarCraft II a lot:

GRUB_DEFAULT="Windows 7 (loader) (on /dev/sda2)"

By using the quotes and the name as it appears on the grub menu, you might be able to save yourself the occasional renumbering of your default choice.

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.