Sunday, June 8, 2008

Booting two separate hard drives

When I first installed Ubuntu, I made the decision to install it as a separate operating system on my second hard drive with it's own grub file so that it wouldn't mess with my Windows drive.
Installing version 8.04 was a very simple process. I simply unplugged my Windows drive and made the second hard drive the master drive. I then rebooted the computer with only the second drive connected and allowed the Ubuntu DVD to boot up and whereupon I installed ubuntu. Once it was installed, I removed the DVD and rebooted that drive. I left the Windows drive unplugged as I only wanted to use Ubuntu and get familiar with it. I installed updates, new software and hooked up my peripheral devices.
I plugged my Windows drive back in so that I can use it as a backup drive for my data. Since the grub/menu.lst file did not have any Windows boot information in it, I can always remove the Linux drive and move it to another computer if/when I upgrade and it will be a plug and play drive.
Recently, I wanted to be able to boot into either Ubuntu or Windows via the grub file. Sounds simple, but since Ubuntu was already installed, that meant editing the menu.lst file. This is simple enough to do, but most information online is for those who have installed ubuntu on their second drive with the grub file located on the windows drive. I had done things the other way around.
I need to add some lines to the menu.lst file to let the computer know that my Windows drive was the slave drive and that I wanted it to boot first and then load Windows instead of Ubuntu.
Here are the steps I took to make this all happen.

Load up the menu.lst file
gksudo gedit /boot/grub/menu.lst

Edit the file to include the following lines.

## ## End Default Options ##

title Ubuntu 8.04, kernel 2.6.24-18-generic

root (hd0,0)

kernel /boot/vmlinuz-2.6.24-18-generic root=UUID=86e9f44e-08bb-470d-98f8-56023839f9c0 ro quiet splash

initrd /boot/initrd.img-2.6.24-18-generic

quiet

title Ubuntu 8.04, kernel 2.6.24-18-generic (recovery mode)

root (hd0,0)

kernel /boot/vmlinuz-2.6.24-18-generic root=UUID=86e9f44e-08bb-470d-98f8-56023839f9c0 ro single

initrd /boot/initrd.img-2.6.24-18-generic


(hd1) /dev/sdb

title Windows XP

root (hd1,0)

savedefault

makeactive

map (hd0) (hd1)

map (hd1) (hd0)

chainloader +1

### END DEBIAN AUTOMAGIC KERNELS LIST


I also changed the boot time and made the menu visible by changing the following lines as shown here:

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 5

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

I wanted to be able to boot into windows without having to reach inside the computer and swap the drive cables to make it the master drive each time. I've tested my changes and it works well, but I have no desire to use Windows at the present time, but I can just choose it from the screen menu on bootup. If I simply turn on the computer and leave it, it will automatically boot into Ubuntu by default, which is just how I like it.

No comments: