How to change the default Operating System to be loaded in the Grub

Posted: April 29, 2011 in Ubuntu
Tags: , ,

Hello everybody. Sometimes we need to change the default operational system to be loaded in the Grub.
However Ubuntu 10.10 uses Grub2 and it does not use anymore the files menu.lst and grub.conf. In my case, the file /boot/grub/grub.cfg has the following menu entries:

Ubuntu, with Linux
Ubuntu, with Linux (recovery mode)
Memory test (memtest86+)
Memory test (memtest86+, serial console 115200)
Windows 7

However, the menu above can be seen when the Grub is started.
To make the change, open the file /etc/default/grub as root privileges. You will see something like that:

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

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

# 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 …)

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

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE=”480 440 1″

Go to the line GRUB_DEFAULT=0. This value indicate as default “Ubuntu, with Linux”. Just for example, let’s leave Windows 7 as default. Change the GRUB_DEFAULT to 4. After that, open a shell and type:

sudo update-grub

Note that, GRUB_DEFAULT follow the sequence of menu entries. In my case is:

[0] Ubuntu, with Linux
[1] Ubuntu, with Linux (recovery mode)
[2] Memory test (memtest86+)
[3] Memory test (memtest86+, serial console 115200)
[4] Windows 7

That’s it folks. See you next time.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s