How To: Dual Booting Linux & Windows On Separate Hard Drives Part 2
- 3 Comment
Overview
- Article 1 covers Introductory Information and Preparations necessary before You Install Any Additional Operating System.
- Article 2 covers System information collection, Necessary Data backup, and Installing Windows.
- Article 3 covers editing the boot information on each hard drive to make the Dual Booting Process seamless.
This article is part 2 of a series of three articles that detail how I got Ubuntu 64 Bit Hardy and Windows XP dual booting on my box while being installed on different hard drives. It differs from some dual booting methods in that I already had linux installed prior to installing windows. Just like anything else though, this method may not work for everyone as it is specific to my system configuration, and that plays a big part in setting up any software. But you may be able to find some bits that help you in your own undertaking.
Getting Started: Collecting System Information
First off, I already had an extra hard drive on my computer that I wasn’t really using so it was a no brainer to use this drive. I started my linux system and fired up the terminal to have a look at the hard drive configuration using the following command.
sudo fdisk -l
I did a whole other how to on disk partitioning with fdisk so there’s no need to discuss it here. Here’s the resultant output from that command. I copied it to a text file and printed it out for documentation.
Disk /dev/sda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x6716af5c Device Boot Start End Blocks Id System /dev/sda1 * 1 9728 78140128+ 7 HPFS/NTFS Disk /dev/sdb: 120.0 GB, 120034123776 bytes 16 heads, 63 sectors/track, 232581 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Disk identifier: 0xe636f951 Device Boot Start End Blocks Id System /dev/sdb1 * 1 232578 117219280+ 7 HPFS/NTFS Disk /dev/sdc: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00c800c8 Device Boot Start End Blocks Id System /dev/sdc1 * 1 13995 112414806 83 Linux /dev/sdc2 13996 14593 4803435 5 Extended /dev/sdc5 13996 14593 4803403+ 82 Linux swap / Solaris Disk /dev/sdd: 60.0 GB, 60022480896 bytes 240 heads, 63 sectors/track, 7753 cylinders Units = cylinders of 15120 * 512 = 7741440 bytes Disk identifier: 0x0000675f Device Boot Start End Blocks Id System /dev/sdd1 2 7753 58605120 f W95 Ext'd (LBA) /dev/sdd5 2 7753 58605088+ 7 HPFS/NTFS Disk /dev/sdi: 5000 MB, 5000970240 bytes 255 heads, 63 sectors/track, 608 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x01a701a6 Device Boot Start End Blocks Id System /dev/sdi1 * 1 608 4883728+ b W95 FAT32 Disk /dev/sdm: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x0000d600 Device Boot Start End Blocks Id System /dev/sdm1 1 19457 156288321 83 Linux Disk /dev/sdp: 257 MB, 257949696 bytes 64 heads, 32 sectors/track, 246 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdp4 * 1 246 251888 b W95 FAT32
As you can see, I have a pretty haphazard drive configuration. My system is a hodge podge of ide and sata drives. The drive that I’m going to install window on is the first one. At this point I have already used partition editor (gnu parted) to format the drive that I’m going to for windows with the ntfs filesystem although this not totally necessary.
Disk /dev/sda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x6716af5c Device Boot Start End Blocks Id System /dev/sda1 * 1 9728 78140128+ 7 HPFS/NTFS
With this printout in had, I reboot the system and go into my bios to try to map the drives to their positions in the system (i.e First SATA Master, Secondary IDE, etc…). From this exercise, I determined that my linux drive was located on the Secondary IDE Master and the drive on which I’m installing windows is located on the First SATA Master.
Knowing this information will be helpful when I need to change the hard drive boot order in the bios. Using this information I will also be able to check whether both operating systems are fully intact before I make the system dual boot automatically. Currently my linux drive is booting first. Now it’s time to boot back into linux.
Next, it’s time to copy some files. Anything you don’t want to lose, you should probably back up. But I was pretty confident I wouldn’t lose any data plus most of my important files are stored on external storage. But I did back up my entire grub directory on my thumb drive just in case I ran into booting problems when trying to access linux after windows had been installed. The GRUB directory contains the essential menu.lst file that I’ll be using to help dual boot the system.
Whew, Finally Time to Install Windows
The first thing I did was change the boot order in the bios so that the drive that is going to contain windows boots first.
Now that was all the preparation for linux I had to do before attempting to install windows. When I first rebooted my system and popped my Windows XP disc into the drive and attempted to install windows, it didn’t go as planned. This was because I’d forgotten what a hyper-aggressive operating system it was. It definitely doesn’t play well with others. Initially when I ran setup, it detected the unknown operating system and kept telling me that it needed to install files on my linux drive. It basically wanted to destroy the MBR(master boot record) and grub boot loader on my linux drive. Obviously I wasn’t going to let this happen.
My solution — I cracked open my case and temporarily unplugged all the disk drives except the one where windows was going to be installed. Windows of course fell for the trick and installed perfectly.
Unplugging all hard drives except the one for windows
Windows Installing on the system
Windows First Run
Windows Fully Booted
After windows installed, I reconnected my other hard drives. Now I had to check to make sure I could boot into linux properly ( I should because windows didn’t touch the linux drive). To do this I have to go back to my bios and and change the boot order of my hard drives so that my linux drive would boot first. And indeed, Linux booted perfectly.
Changing the boot order so ubuntu boots up
Ubuntu Works perfectly
Summary
So now I have 2 hard drives — one with linux installed and one with windows xp installed. Each of these drives has its own MBR and each is perfectly intact. It’s almost like having two different computers because booting into each operating system as it is right now requires that I go into the bios and change the hard drive boot order. Whichever drive is first in the boot order, it’s operating system is the one that will be loaded. Automating the boot process so this is no longer required will be tackled in part 3 of the series.
KJ
Related Articles
3 Comments on this post
Trackbacks
-
Max said:
what are your two drives set as, master or slave?
Thanks!
October 2nd, 2008 at 8:43 pm -
kj said:
Hi,
Windows is loaded on a drive set as First SATA Master, and
Linux is loaded on a drive set as Secondary IDE Master.Kim
October 2nd, 2008 at 9:48 pm













[...] Article 2 covers System information collection, Necessary Data backup, and Installing Windows. [...]