Google Plus

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

Written by Mel Kham on . Posted in Linux tutorials

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_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”

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}

For questions please refer to our Q/A forum at : http://ask.unixmen.com

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.
  • 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

    Hi,

    Yes, i think.

    First:
    sudo gedit /etc/default/grub

    Second:
    Changed the GRUB_DEFAULT to 4.

    Third:
    sudo update-grub

  • http://jamiekrug.com/blog/ 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.

  • http://aphatak.blogspot.com 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?

    • 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

      • http://enteryoursiteURL... Thomas

        Thanks Arik worked perfect.

  • Anonymous_dude

    Thanks for this!!

  • 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)"

  • sagar

    you can add more content like :http://goo.gl/qxLdl
    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

    Possition-1

  • 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
    2.windows

  • Bill

    https://help.ubuntu.com/community/RootSudo#Graphical_sudo

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

    http://ubuntuforums.org/showthread.php?p=4635537#post4635537

    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: http://www.howtogeek.com/howto/43471/how-to-configure-the-linux-grub2-boot-menu-the-easy-way/

    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

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

Pat L

|

I tried it and it works with a regular zip file, but if you password-protect the .zip file it does NOT work.

SK

|

Yes we can. What kind of help you need? We are doing outsourcing and technical support for Linux and Open source worldwide. To know more about the details visit here.

ClintB

|

After install as above, run shell script /opt/Citrix/ICAClient/wfica.sh manually and note lib errors still occur. I had the x64 motif loaded but had to manually install the x86 too. Got that from http://rpmfind.net/linux/rpm2html/search.php?query=libXm.so.4 Even after that, I still had to do a “yum install alsa-lib.i686 alsa-lib.x86_64″ to resolve any additional libasound.so.2 errors. Once those two lib issues were resolved, Citix Web Interface launched apps fine by telling browser to open launch.ica using /opt/Citrix/ICAClient/wfica.sh. Good luck Ernesto!

AD

|

I need some Help on Linux,can you guide me ?

Edson Carlos

|

In debian no found. I need link download install in linux debian

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .