Dual Boot RAID Windows and Linux

Installing Linux

Linux
Reboot with your favourite distro install disk in the CD drive. For this to work you'll need a distro with the kernel on the install CD that supports two features: MD and LDM. The first, MD is the multiple disk driver - your software RAID support. It handles everything from RAID 0 to RAID 6 and JBOD. The other allows Linux to read and work with LDM, or Logical Disk Manager (aka Dynamic Disk) partitions. Without the LDM driver, ther kernel only sees a generic unified partition which Windows uses as its 'Dynamic Disk' format. Thankfully the LDM driver for Linux exists, or this guide wouldn't be possible.

#Note: Generally, MD and LDM are so common any modern distro should have them built into their kernels. If you prefer to build your own kernel on an install disk, you'll find LDM under Filesystems-> Partition types (then select 'Advanced Partition Selection' and Windows Logical Disk Manager') and the MD driver under Drivers-> Multi-disk driver.

1. At the partition stage you should be able to see and manipulate the same partitions you made in Windows. All you want to do here is create the Linux software RAID 0 array and install Linux onto it, with the exception of /boot. You may need to modprobe the MD driver if your distro doesn't load it. The LDM driver is a compile-in only affair.

2. If you're doing things the manual way (such as with Gentoo) you'll need to make sure the tools from either the 'raidtools' or 'mdadm' packages are available on the install disk. You can assemble your RAID 0 array with mdadm like so:

mdadm --create/dev/md0/devsda2
/dev/sdb2 -n 2 -1 0 -c 64

Distributions that have no problem loading and using both MD and LDM include Red Hat, SuSE, Mandriva, and Gentoo. The first three even include install features to setup RAID arrays from partitions for you. Neat eh!!!

3. Allocate the partitions as per the layout you want, and install Linux. Going by the diagram I had included previously, this means allocating /dev/sda2 and /dev/sdb2 to md0, /dev/sda3 and /dev/sdb3 to md1, and installing / to md0 and allocating your swap to md1.

#Note: You can also use other methods of building drives into spanned file systems with evms, device mapper, and the like but as you'll see sticking with straight MD keeps it simple and, as I'll cover below, cross platform.

The Boot Loader
So far, it's been relatively simple. It's just a standard dual boot install making use of software RAID under each OS, and it's been made possible by the kernel's support of LDM. Which if you think about it presents us with a bit of a chicken and egg problem: In order to see LDM partitions, the kernel needs to load. But in order to load the kernel...the partitions need to be visible. No problerm!!! Well, actually it is a little. There are two ways to handle this.

A) The first is to install your /boot and boot manager to a third hard drive. Even if it's just a simple data drive, there's nothing stopping you making this your bootable drive in the system, loading a Linux boot manager, and booting Linux or Windows accordingly. It's certainly a safe and simple option. Alternatively, this boot device could be a USB key.

B) The other option is to install LILO onto the second drive (so as to not overwrite the Windows NT boot manager, which you need). LILO can handle LDM partitions, whereas Grub cannot, so it's your only choice here. Your distro, if it's got a nice installer, will offer to install LILO for you and will even find and add to the boot menu your Windows boot. Just because you're running different OS's, and different software RAID arrays no less, doesn't mean the two can't play together. You'd think that the chances of Windows being able to read a Linux software RAID array are next to nil. And you'd be right. You'd also think that, naturally, Linux wouldn't be able to read that lovely NTFS Windows software RAID array from Windows. But in actual fact it can. To be more precise, the MD driver can, with no more configuration than you've already done to setup a Linux software RAID array. The easiest way to do this on a permanent basis where you can mount and unmount the Windows RAID as you desire is to set it up as an entry in your /etc/raidtab, like so:

raiddev /dev/md2
raid-level 0
chunk-size 64k
persitent-superblock 0
nr-raid-disks 2
device /dev/sda4
raid-disk 0
device /dev/sdb4
raid-disk 1

The two most important settings to specify here are 0 for the persistent superblock (because of course NTFS partitions don't), and to use a chunk size of 64KB. And of course, you need the NTFS file system module installed or loadable. After that, accessing the Windows RAID is as simple as running:

raid0run /dev/md2
mount -t ntfs /dev/md2 /mnt/windows

Or whatever directory you want to mount it to. The raid0run command is part of the 'raidtools' package. You could probably use mdadm to force it to run, but raid0run will do as it says without playing with switched. The raid0run command forces the assembly of a RAID device, irrespective of whether the partitions sport a valid superblock or not. You can unmount it anytime with:

unmount /mnt/windows
raidstop /dev/md2

#Note:
If MD complains that there aren't enough MD devices present in /dev, you can make another like so ( the example being here md2):

mknod 2 b 9 2


Now that we've installed Windows and Linux and organised the boot loader, let's get onto booting up...
«Prev 1 2 3 Next»

Most Recent Comments

20-02-2006, 18:51:47

FragTek
http://blog.washingtonpost.com/securityfix/2006/02/wanted_critical_windows_flaw_r.html?www.dailytech.com

This is a local company, located about 15 minutes from my house. They're giving out $10,000 to any people that find security vulnerabilites in Windows deemed "critical" by Microsoft. That's a pretty good chunk of change.

I just hope the poor company doesn't go out of business paying for all of the flaws Winblows has :D haha

20-02-2006, 21:34:57

Tec
Maybe they made a deal with MS that any flaws they find they get $20000 , so still 50% profit otherwise i doubt they will do such a campaign without any gain as it looks insane :)

20-02-2006, 21:43:23

FragTek
I say we band together to find a flaw and then split the earnings :)

21-02-2006, 02:43:10

Jim
We could hire an Indian coder from rentacoder.com for $50 to do it for us, and then take the credit ;)

21-02-2006, 06:50:22

FragTek

We could hire an Indian coder from rentacoder.com for $50 to do it for us, and then take the credit ;)


rofl, I'm in! :D

21-02-2006, 06:51:52

Jim

rofl, I'm in! :D



Isn't oursourcing to India great :D lol

21-02-2006, 06:53:46

FragTek

Isn't oursourcing to India great :D lol


Rofl they'll do anything for $50!

21-02-2006, 18:34:06

Hyper
Why dont we rent 10, just to make sure :D

21-02-2006, 19:02:45

Phnom_Penh
They don't seem to state which windows they're offering the money on... :confused:

21-02-2006, 19:05:39

FragTek
Hrmm... I would imagine any currently supported version (XP, MCE, 2k3).
Reply
x

Register for the OC3D Newsletter

Subscribing to the OC3D newsletter will keep you up-to-date on the latest technology reviews, competitions and goings-on at Overclock3D. We won't share your email address with ANYONE, and we will only email you with updates on site news, reviews, and competitions and you can unsubscribe easily at any time.

Simply enter your name and email address into the box below and be sure to click on the links in the confirmation emails that will arrive in your e-mail shortly after to complete the registration.

If you run into any problems, just drop us a message on the forums.