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}