UPDATE (April 2010): The information in this post is outdated! Most linux distributions, including Ubuntu, are moving to GRUB 2. Because the contents of this post is about the previous version of GRUB, it is fast becoming obsolete. More about GRUB 2 here: https://help.ubuntu.com/community/Grub2
I have an Ubuntu/WinXP dual-boot machine. The GRUB bootloader menu allows me to boot into several Ubuntu options or into WinXP. Unless I have to fix something (which I hope I won’t have to), I only ever choose the main Ubuntu option or WinXP. These options are, however, at either ends of the list. I’d prefer them to be next to each other for quick access.
Here’s a helpful reference. And here’s what I did:
The GRUB boot menu configuration is in the file
1. backup menu.ls:
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst-backup
2. edit menu.ls:
sudo gedit /boot/grub/menu.lst
3. Move the paragraph with the WinXP options up the list.
4. Change default to 1 (was 0)
5. comment out the lines about “Other operating systems”
So now I have the following options when booting:
- Microsoft Windows XP Professional
- Ubuntu, kernel 2.6.17-10-generic
- Ubuntu, kernel 2.6.17-10-generic (recovery mode)
- Ubuntu, memtest86+
…and the second option is automatically selected and boots-up after 10 seconds if I don’t do anything.
Here is the contents of the resulting file (showing only the uncommented lines)
title Microsoft Windows XP Professional
title Ubuntu, kernel 2.6.17-10-generic
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sda5 ro quiet splash
title Ubuntu, kernel 2.6.17-10-generic (recovery mode)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sda5 ro single
title Ubuntu, memtest86+
I should emphasize the importance of the first step, i.e. backing up the original menu.ls file. I’d like to quote a comment on a relevant website here for future reference:
TuxGirl wrote: As a side note, I think it’s important to mention that, if you do manage to completely mess up your grub.conf [or menu.ls] file to the point that your machine won’t boot, you can fix it by booting into a livecd (like the Ubuntu livecd or Knoppix or DSL or *something*), and then copying your backup grub.conf [or menu.ls] over while in there. In fact, this method is great whenever you do something to your system that makes it temporarily unusable.