How to change the default boot order for Grub2 in Ubuntu 10.04 and Ubuntu 10.10 Maverick Meerkat

This is a quick tip for people that want to change Grub2 boot order in ubuntu 10.04 and 10.10. In Grub2 you can no longer edit menu.lst (sudo gedit /boot/grub/menu.lst) . Now the file we have to edit is Grub and is located in /etc/default/grub.

Here are the steps to follow:

1- To edit the grub file open terminal and type the following command :

sudo gedit /etc/default/grub

You will got something like this :

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

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

# 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’

# Uncomment if you don’t want GRUB to pass “root=UUID=xxx” parameter to Linux

# Uncomment to disable generation of recovery mode menu entrys

Now to change the boot order, you need to change the GRUB_DEFAULT Entry, for example you have  windows7 in the 3rd position and you want to set it as default, to do that set default to 3:  GRUB_DEFAULT=3

2- Now update Grub using the command:

sudo update-grub

And is done!

{loadposition user9}

  • freemind

    It didn’t work with me. :/

  • Zinovsky

    I test it several time and working perfectly, did you follow all the instructions as described in the post?

  • freemind


    Yes, i think.

    sudo gedit /etc/default/grub

    Changed the GRUB_DEFAULT to 4.

    sudo update-grub

  • Jamie Krug

    @freemind: The first boot option is 0 (zero), not 1 (one). So, if the default you desire is the 4th row in your Grub boot menu, try setting GRUB_DEFAULT=3.

  • aphtk

    But this (3 or 4) is a static value. Is there a way to find index of a Windows entry ? or better yet pipe it into the default file so we don’t have to do this by hand everytime?

  • Anonymous_dude

    Thanks for this!!

  • Arik

    install start-up manager
    sudo apt-get install startupmanager
    it has GUI, once installed it’ll be System=>Administration=>start-up manager
    you can change your system boot order in just three clicks

  • Dave E

    related to this, I have set windows to the default using Startup Manager. However, I understand that the periodic update to the kernal changes this, so you need to re-set the default when this happens. Second, having to re-install my Meerkat, I have ended up with duplicate entries for the Gnome and Recovery bootups, so instead of the 4 Ubuntu and 1 Windows Entries, I now have 6 Ubuntu entries. How can I edit the actual listing of bootup entries to remove the extra 2? Third, I understand that the bootup entries are numbered from 10 & up, and that the Windows entry can be edited changing the number to 9, so that it is always the first (default).

    This is just stuff I have read and have been told. Can anyone confirm these and advise the processes?

  • Grace Crammer

    hi! i’ve made the rounds in the internet but could not find instructions to change boot order from linux mint 10 to
    windows xp. . i have smb as boot editor when i type in the sudo command, i have the error message ‘COMMAND NOT FOUND". i’m at wit’s end. please help.

  • Grace Crammer

    so sorry. correction to my original message:

    i have smb as boot manager and gedit as text editor ^_^

  • gramos_dot

    I suggest change de GRUB_DEFAULT (in /etc/default/grub)to assign the label that the Windows partition boot (or any other SO that you want) have. For example:

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

  • http://enteryoursiteURL... Thomas

    Thanks Arik worked perfect.

  • sagar

    you can add more content like :
    in this the content are quite worthy..

  • Bob Willies

    This is wrong.
    The numbering starts at 0, so if windows is in possition 3, GRUB_DEFAULT should be 2


  • Marcel

    If windows is in the 3rd position you need to set it to 2.

  • joshua voet

    It wont let me save the file. What do i do?

  • http://stfu tk

    sudo gedit dummy

  • http://stfu tk

    also you start counting from 0 if windows is your 3 choice you would change default to 2

    0. linux
    1.linux failsafe

  • Bill

    sudo is not recommended to start a graphical application.
    gksudo is preferred.

    I apologize for my extremely advanced knowledge of the English language, I grew up in America. ;P

  • Adrian May

    Which plonker came up with that idea? It’s only gonna be in position 3 until the next kernel update or driver installation!

  • bleh

    Excuse me, I never really say this, but: How very f***ing useful. 3 year ubuntu user, and I’m growing tired of all this commands to adjust the simplest things, that NEVER fakking works!

    My windows partition isn’t even in that grub file.

  • bleh

    Alright,  sorry for venting. Now to present a method that actually worked even for me, just install the grub-customizer as described here:

    Its not that Im afraid of the command line, but sometimes I want things to just work dammit.

  • PRS

    Well, it worked fine for me, thanks.

  • Kodisrinivas

    how to change boot priority in dual os unix windows

  • BrendanC

    How about during installation of linux it asks you what partition you want as default boot – rather than assuming you want linux as your default?!

  • mikko353

    I have many ubuntus in this PC. Is there method other than trial error to find out in which ubuntu installation I should follow these instructions e.g. in which ubuntu I should run sudo gedit /etc/default/grub etc

    tnx, M

  • Joshua Sulwer

    did not work for me. installed the startupmanager app, chose the system I wanted to be default, but it still loaded the newest installed one. thx anyway

  • Anon

    use sudo.
    Probably you are still in normal user.

  • Rg

    As the order starts with 0, hence for changing the 3rd position, the default value must be set to 2