Saturday, April 21, 2007

Reconfiguring Boot Order - For the Linux newbie like me

As much as I'm drawn to Linux and I've had very positive experiences with it, I still prefer to do most of my work in Windows (It's a matter of preference -- not to mention that a lot of my classes require software that only runs on Windows). So, I was a little frustrated when upon first installing Ubuntu last year it claimed itself as the first item in the boot order. I'd restart my laptop from linux to go back to Windows... only to end up back in Ubuntu. So, here's how to simply rearrange the boot order in GRUB. (Note: you should probably back up your menu.lst file before doing this)

Open up a terminal and give the command:
sudo gedit /boot/grub/menu.lst

This will open up the menu list that GRUB uses to generate the list you see when your computer boots. If you scroll to the bottom of this file, you'll find a list of nicely commented commands for the various OSes on your computer in the order in which they appear in the GRUB loader.

It will look something like this:




If you scroll all the way to the bottom, it will list your other operating systems, ie. Windows. All you need to do is cut and paste the ENTIRE entry for Windows up to above the Ubuntu entries. You will want to paste it just below the text that says "## ## End Default Options ##." The entire entry you want to copy consists of (at least for Vista)

title Windows Vista/Longhorn (loader)
root (hd0,0)
savedefault
makeactive
chainloader +1

New menu.lst file:


Save the menu.lst file, and that's all!
With this entry at the top of the list, when your computer boots it will now default to Windows (or whatever other entry you chose to place first).

Note: I have heard that this trick might become switched back when there's a kernel update which edits the menu.lst file. Should this happen to you, it should only take a few moments to change it back.

No comments: