Change default boot order
This page was last updated on July 18, 2009.
To choose the default entry that GRUB loads when you boot your computer, you can change this setting.
- Back up GRUB:
- Open the /boot/grub/menu.lst file. In a terminal window type one of these commands:
- GNOME users:
- KDE users:
- In the editor you just opened, read the file from the top down. Count each line that begins with “title” (ignore everything else!), stopping the count at the entry you wish to have loading by default. In this example, I’ve removed everything except for the “title” lines so you can see how it’s being done. Your title lines might look something like this:
- GRUB starts the count with zero, so begin counting at zero and work your way down to the title line that has the name of the entry you wish to load by default. If, for instance, you want XP to load by default, you must count all the title lines, finishing the count at the XP line. Since we began the count with zero, XP is the 4th entry, as seen here where I used indicators showing how the lines were counted:
- Now that you know the number to use for your default entry, do a search in the file for a line that begins with “default”. The line will look something like this:
- Change the number to the number for your chosen default entry. From our example above, XP was the 4th title entry, so the line would be changed to this:
- Save and exit the file.
- Reboot the computer.
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.`date +%b-%d-%Y~%T`
gksudo gedit /boot/grub/menu.lst
kdesu kate /boot/grub/menu.lst
title Ubuntu, kernel 2.6.20-14-generic title Ubuntu, kernel 2.6.20-14-generic (recovery mode) title Ubuntu, memtest86+ title Other operating systems: title Microsoft Windows XP Home
title Ubuntu, kernel 2.6.20-14-generic <--- 0 title Ubuntu, kernel 2.6.20-14-generic (recovery mode) <--- 1 title Ubuntu, memtest86+ <--- 2 title Other operating systems: <--- 3 title Microsoft Windows XP Home <--- 4
default 0
default 4
NOTE: Whenever the kernel is updated, the new kernel will be added to the file as an entry in GRUB. This will change the numbering of the entries and you’ll need to follow these instructions again to ensure that the proper entry is selected by default.
Obligatory Happy Ending
And they all lived happily ever after. The end.
