Change Default Boot Order for Grub 2 in Ubuntu 11.04 Natty or 10.10, 10.04 etc

1 Star2 Stars3 Stars4 Stars5 Stars (14 votes, average: 4.64 out of 5)
Loading ... Loading ...

Ubuntus 9.10, 10.04, 10.10, 11.04 etc. use Grub2 so if your are using any of these versions of Linux then this trick should work for you. This post discusses the standard command line approach as well as GUI approach, discussed at the end of this post.

With Grub 2 you can no longer edit grub.conf or menu.lst files located in /boot/grub folder. The file to be edited is now “grub” located in /etc/default/ folder, you can edit it by running the following command from terminal (sudo gedit /etc/default/grub). The contents would look like this:

If you change this file, run ‘update-grub’ afterwards to update
# /boot/grub/grub.cfg.

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=”"

# 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=640×480

# 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 entrys
#GRUB_DISABLE_LINUX_RECOVERY=”true”

To change the default boot option, you just need to change the GRUB_DEFAULT parameter. 0 is the first entry, so if you want windows to be your default boot option which is, say at, 6th position in the grub menu, then you just need to change the GRUB_DEFAULT value to 5 and save the file and close it.  If you want to change the Auto Boot preset time then you would need to change the value of GRUB_TIMEOUT parameter, it should be assigned a value in seconds and would determine the delay in seconds before grub boots the default choice, automatically. Now from the terminal run following command and your grub default boot order would be changed when you boot the next time:

sudo update-grub

GUI Approach

Just install the startup manager by using synaptic or running the following command

sudo apt-get install startupmanager

Now launch System > Administration > StartUp-Manager and you can change the boot order using graphical interface.

If you found this useful, please consider leaving a comment or liking us on Facebook or subscribing to the RSS feed to have future articles delivered to your feed reader.

Possibly related posts (generated automatically):

  1. Change Default Boot Order for Grub in Ubuntu 10.10 Maverick Meerkat
  2. Change Default Boot Order for Grub 2 in Ubuntu 11.10 Oneiric Ocelot
  3. Change Default Boot Order in Grub for Fedora 13
  4. Change Default Boot Order / Sequence for Grub2 in Fedora 16 Verne
  5. Change Default Boot Order Fedora 15 Lovelock
  6. How to Change Default Grub Theme or Splash Image in Ubuntu 11.04 and 10.10
  7. Uninstall Grub (Replace Grub with Windows 7 Boot Loader)
  8. Restore Grub 2.0 after Windows 7 Install (Ubuntu 11.04, 10.10, 10.04 or 9.10)

You might also like

Change Default Boot Order / Sequence for Grub2 in Fedora 16 Verne Fedora finally...
Restore Grub 2.0 after Windows 7 Install (Ubuntu 11.04, 10.10, 10.04 or 9.10) I had Ubuntu...
Change Default Boot Order for Grub in Ubuntu 10.10 Maverick Meerkat Command-line...
Change Default Boot Order for Grub 2 in Ubuntu 11.10 Oneiric Ocelot Ubuntus 11.10...

About the Author

has written 1314 posts on this blog.

Meditating towards his "nerdvana", lifehacker is a teacher by the day and a nerdy blogger by the night. He lives to learn and yearns to learn living.

31 Comments on “Change Default Boot Order for Grub 2 in Ubuntu 11.04 Natty or 10.10, 10.04 etc”

  • marv wrote on 11 May, 2010, 19:36

    thanks for this simple, yet followable article.
    i’m amazed at how cryptic unix folks can be. i actually think linux based os’s could smear windows easily IF the developers would start using understandable, readable and pronounceable utility names instead of 5 consonants and 1 vowel???? it quickly threatens most users.

    Well-loved. Like or Dislike: Thumb up 17 Thumb down 0

    [Reply]

  • Sandeep Maske wrote on 22 May, 2010, 13:21

    Hey all ubuntu 10.04 LTS users…….i have a problem regarding Grub menu… i have DELL XPS 1645 (64 bit) laptop with installed windows 7 (64bit).

    I properly installed ubuntu 10.04 LTS as you recommended. Now when i restart my laptop, by default it boots ubuntu (means he doesn’t show me options which is to be boot Win 7 or ubuntu). I am unable to access win 7. I tried to change grub config file but same error occur. how to set win 7 default? Please help me………….

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • lifehacker wrote on 22 May, 2010, 13:55

    @Sandeep Maske
    First, when you boot Ubuntu, can you still see the Windows partition intact, I mean can you access files and folders there?
    Can you post the content of your /etc/default/grub file here. Then I can tell you what the problem is.
    Also before you do that, when you reboot, press any key as soon as you get out of the bios, then you should see the grub menu, which should have several entries, does Windows have any entry in that menu?

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • José Velásquez wrote on 1 June, 2010, 9:00

    Hidden due to low comment rating. Click here to see.

    Poorly-rated. Like or Dislike: Thumb up 7 Thumb down 13

    [Reply]

  • lifehacker wrote on 1 June, 2010, 14:02

    @José Velásquez
    Come on guys, you just need to give it some time. Spend some time with Linux and it just grows over you. With Ubuntu, I can do wonderful things for free, which would otherwise cost me a fortune to do on Windows platform.
    We should not pick on things that are free. :)

    Like or Dislike: Thumb up 5 Thumb down 2

    [Reply]

  • TheDefiant wrote on 5 June, 2010, 7:01

    @José Velásquez
    Quite right. Its for angels

    Like or Dislike: Thumb up 2 Thumb down 0

    [Reply]

  • Kevin wrote on 11 June, 2010, 8:05

    Hi all i recently installed ubuntu 9 on my pc laptop. i have to tell u im very pleased with it. only one thing happend and im not shure how to fix it. before installing ubuntu i had a dualboot of winxp and win 7
    now i created another partition to install ubuntu. it installed fine but i cant boot win xp or win 7 anymore it only loads the “loader” to reinstall win xp and win 7. how can i fix this?? greets from a newbee in the ubuntu world

    Kevin

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • lifehacker wrote on 11 June, 2010, 9:28

    @Kevin
    If you installed Ubuntu 9.10 or 10.04, run this command at the terminal and Grub should update the list of available OS

    sudo update-grub

    and reboot and the option to choose XP or Win 7 should now appear in initial boot menu

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • maxx wrote on 11 June, 2010, 22:13

    thankx guys it works for me!

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

  • mahfuz wrote on 19 June, 2010, 10:10

    my 10.04 grub loader shows my Xp in the menu but when i click it it return to menu again.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • Marty wrote on 7 July, 2010, 4:54

    Hidden due to low comment rating. Click here to see.

    Poorly-rated. Like or Dislike: Thumb up 0 Thumb down 6

    [Reply]

  • Marty wrote on 7 July, 2010, 4:59

    To lifehacker- Would you could you look at my posting and maybe help me out. I am still new at the Ubuntu but am sold on it 100%, but still need to use windows programs that just aren’t available in Ubuntu yet. Thanks in advance.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • lifehacker wrote on 7 July, 2010, 10:19

    @Marty
    Please post the contents of your

    /etc/default/grub

    file, because this is the one which you need to edit to generate the /boot/grub/grub.cfg Also try running the command sudo update-grub and post the output here.

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

  • Vic Main wrote on 7 September, 2010, 0:10

    Hi:

    Thanks very much for the valuable info, just editing the grub has helped in my understanding of Linux. It worked exactly as stated. I’m dual booting XP & Ubuntu 10.04 on different drives.

    vic

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • oblikovanje strani wrote on 10 September, 2010, 7:13

    Thanks for this tip, this changes are making me nutts! I think this change is completely unnecessary.

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

  • saleh wrote on 20 June, 2011, 8:40

    Thanks!

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • Peter.wi wrote on 14 August, 2011, 6:48

    I changed via grub and startup manager, updated grub tested a couple of times but stilll does no good – first position will allways remain as defualt no matter what i put as GRUB_DEFAULT parameter

    Like or Dislike: Thumb up 2 Thumb down 0

    [Reply]

    lifehacker Reply:

    @Peter.wi, Yes the first position doesn’t change, but the default selection (the highlighted text) changes, and the highlighted choice is going to be the default boot choice. Let me know if that is the case?

    If I remember correctly older grub used to have this functionality where the default boot choice would have to be the first choice in the list. Not anymore!

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • Peter.wi wrote on 18 August, 2011, 4:09

    @lifehacker,
    the point is the highlighted GRUB section will still be position 0 instead of whatever  GRUB_DEFAULT is set to. GRUB costumizer did the thing for me though

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

    lifehacker Reply:

    @Peter.wi, OK, great. Thanks for letting us know.

    Like or Dislike: Thumb up 2 Thumb down 1

    [Reply]

  • Ross wrote on 15 September, 2011, 20:34

    I initially had trouble because I didn’t subtract 1 from the position in the grub menu.  Since the first item in the menu is 0, to default to the 7th in the list you would use GRUB_DEFAULT=6.  It worked fine after that.  For some reason, the GUI method using startup manager didn’t work, even though it seemed to save the settings.

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

    lifehacker Reply:

    @Ross, Thanks for sharing your experience. Hmm startup manager has been giving trouble to some other folks too. I’ll try to look in to it. Since, the command line approach works the best, I usually don’t bother to use the GUI methods.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • Dan wrote on 4 October, 2011, 16:16

    > the GUI method using startup manager didn’t work, even though
    > it seemed to save the settings. ( Ross wrote)

    I had the same experience. After a few tries, I did the editing via terminal instructions given first. I noticed that the Startup Manager managed to edit the other params I’d changed, but had not counted binary in assigning the most important param, the GRUB_DEFAULT. It had written 6. I changed it to 5, did the ‘sudo update-grub’ call, and it now works.

    Thanks to all.

    – dan feather

    Like or Dislike: Thumb up 2 Thumb down 0

    [Reply]

  • Joe wrote on 6 April, 2012, 8:10

    Thanks for the simple to follow directions. I was not aware that there was a GUI interface. I installed that and it worked just fine!

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

Trackbacks

  1. How to Create A Perfect Linux Desktop Using Ubuntu 10.04 « Hack Your Life!
  2. Dual Boot Windows 7 and Ubuntu 10.04 Lucid Lynx « Hack Your Life!
  3. Restore Grub 2.0 after Windows 7 Install (Ubuntu 10.04 or 9.10) « Hack Your Life!
  4. Anonymous
  5. Restore Grub 2.0 after Windows 7 Install (Ubuntu 11.04, 10.10, 10.04 or 9.10) - Hack Your Life!
  6. Anonymous
  7. Dual Boot Windows 7 and Fedora 16 Verne (Step by Step Guide) - Hack Your Life!

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

*
Your Ad Here

Copyright © 2012 Hack Your Life!. All rights reserved.
Proudly powered by WordPress. Developed by Deluxe Themes