QuickTip: Changing the Default OS Selection for Ubuntu

Posted on Saturday, August 2, 2008

2


On my other laptop I wanted the default selection to be Window$ XP instead of Ubuntu, since my father needs to use it. Changing the default order is a matter of changing one file menu.lst

sudo gedit /boot/menu.lst

Of course you would have to give your password. This would open a file which would look like this


## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify ‘saved’ instead of a number. In this case, the default entry
# is the entry saved with the command ‘savedefault’.
# WARNING: If you are using dmraid do not use ‘savedefault’ or your
# array will desync and will not let you boot your system.
default 0
…….
…….
title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,5)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=1737620b-6d81-47bd-9247-77ab2c121b8b ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root (hd0,5)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=1737620b-6d81-47bd-9247-77ab2c121b8b ro single
initrd /boot/initrd.img-2.6.24-19-generic

title Ubuntu 8.04.1, kernel 2.6.24-18-generic
root (hd0,5)
kernel /boot/vmlinuz-2.6.24-18-generic root=UUID=1737620b-6d81-47bd-9247-77ab2c121b8b ro quiet splash
initrd /boot/initrd.img-2.6.24-18-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-18-generic (recovery mode)
root (hd0,5)
kernel /boot/vmlinuz-2.6.24-18-generic root=UUID=1737620b-6d81-47bd-9247-77ab2c121b8b ro single
initrd /boot/initrd.img-2.6.24-18-generic
…..
…..
### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1

The key here is to change the “default 0” option to the option for windows. How do you count?

Start counting the # of title words starting as the first word of the line till you reach the window$ title. Remember to start counting from zero onwards
title Ubuntu 8.04.1, kernel 2.6.24-19-generic would be 1

title Other operating systems: would be 4 and

title Microsoft Windows XP Professional would be 5

So, you would change the “default 0” to “default 5” and the work is done.

There is another option called “default saved”. This would remember your last saved option. Hence if you logged into Window$ the last time then it would remember that and log into Window$.

Advertisements
Posted in: linux