Saturday February 11, 2012 6:20 AM AEST

Building your own RAID.

By Craig Simms
11:18 Nov 21, 2006
Tags: raid | jbod | raid1 | raid0 | raid5 | raid6 | raid10 | raid1e
«  »
Building your own RAID.
All this theory is good, but let’s get our hands dirty with the various methods of RAID enabling.

Windows
After hooking up your drives, go to Settings > Control Panel > Administrative Tools > Computer Management > Disk Management and convert all the disks you want in the RAID array to Dynamic disks. This allows them to exist as just a volume rather than a physical drive according to Windows, letting you stripe to your heart’s content.

Right click on the drive name and select ‘Create New Volume’. Here’s where the interesting bits start, as you’ll notice that you can only span (JBOD) or stripe (RAID 0) a number of disks together. It seems mirroring and RAID 5 are only available to the server variants of Windows. Fortunately the functionality is actually in Windows XP, it’s just simply denied because the disk management is detecting what OS you’re running. It’s time to hex edit some files and tell disk management that Windows XP is what it’s looking for, not Windows Server.

Grab any hex editor (the one at www.physics.ohio-state.edu/~prewett/hexedit is fine), then copy the following files somewhere safe:

C:\windows\system32\drivers\dmboot.sys
C:\windows\system32\dmconfig.dll
C:\windows\system32\Dmadmin.exe

Treat these as your original files. Create another copy – these will be the ones you’ll edit.

Now, as Windows Update has its way, the byte references for the changes we’re about to make may change. Also note that the files could be overwritten in a future Windows Update, so basically if you’re going to do this, don’t use Windows Update.

For the following changes, it will be easier to make them on the ASCII side until you hit the dots, which are representations of the hex byte 00 – you’ll have to do these on the other side.

Open up dmboot.sys in your hex editor, and change the bytes as follows, around the 11070 mark.

HEX
From: 57 49 4e 4e 54 00 00 00 53 45 52 56 45 52 4e 54 00 00 00 00
To: 53 45 52 56 45 52 4e 54 57 49 4e 4e 54 00 00 00 00 00 00 00

ASCII
From: WINNT...SERVERNT
To: SERVERNTWINNT....

For dmconfig.dll, you want around 5140.

HEX
From: 4c 41 4e 4d 41 4e 4e 54 00 00 00 00 53 45 52 56 45 52 4e 54 00 00 00 00 57 49 4e 4e 54 00 00 00
To: 4c 41 4e 4d 41 4e 4e 54 00 00 00 00 57 49 4e 4e 54 00 00 00 00 00 00 00 53 45 52 56 45 52 4e 54

ASCII
From: LANMANNT....SERVERNT....WINNT...
To: LANMANNT....WINNT.......SERVERNT

Finally for dmadmin.exe you want byte 1C30.

HEX
73 65 72 76 65 72 6e 74 00 00 00 00 6c 61 6e 6d 61 6e 6e 74 00 00 00 00
77 69 6e 6e 74 00 00 00 00 00 00 00 6c 61 6e 6d 61 6e 6e 74 00 00 00 00

ASCII
servernt....lanmannt....
winnt.......lanmannt....

Save each as you finish with them. Now we can’t simply overwrite the files – Windows’ system protection would undo us – we need to jump into the Recovery Console.

First, copy the files to either floppy disk or CD-ROM – the Recovery Console is overly Draconian about which directories you can access.

When you are done (making sure to make both the original and modified files available, in case something goes wrong), stick in your original Windows XP CD-ROM (unattended setups tend not to give the option of the Recovery Console), reset your system and boot from CD.

Select ‘R’ from the first menu for the Recovery Console, and log on to your Windows install, then enter the administrator password.

Browse to where you have the altered files stored, and type:

copy dmboot.sys c:\windows\system32\drivers
copy dmboot.sys c:\windows\system32\dllcache
copy dmconfig.dll c:\windows\system32
copy dmconfig.dll c:\windows\system32\dllcache
copy dmadmin.exe c:\windows\system32
copy dmadmin.exe c:\windows\system32\dllcache

Copying the files into dllcache will stop Windows overwriting them with the originals later.

Type ‘exit’, then head back into Windows and disk management. Mirrored setups and RAID 5 should now be available for you to add volumes to.

Mirrored RAID took 2 hours, 18 minutes to synchronise with two drives. RAID 5 with three drives took 8 hours, 24 minutes to generate, while interestingly with four drives it only took 7 hours and 42 minutes – either way, be prepared to wait.

Linux
Linux requires no hacking, and it’s our wonderful friend mdadm that will do the job.

It’s actually really simple – using a modern distribution (in our case, Suse 10.1) should overcome any SATA port compatibility problems, and a lot are bundled with the mdadm package.
To create an array, simply type:

mdadm --create /dev/md0 --level=x --raid-devices=y /dev/sda /dev/sdb /dev/sdc /dev/sdd

Substituting the x for the level of RAID you want (Either 0, 1, 4, 5 or 6), y for the number of devices in the array, and /dev/sda /dev/sdb /dev/sdc /dev/sdd for the actual devices you want included in the array.

Assuming everything is successful, the RAID device /dev/md0 should be created. Now all you need to do is create a filesystem on it (for example, mkfs.ext3 /dev/md0), mount it (e.g. mount /dev/md0 /uberstorage) and you’re away.

Make sure you add the device to /etc/fstab to load the array with each start. There’s a buttload more options for managing the array, sending alerts upon failure and the like, so make sure to pore through the man pages.

click to view full size image
Random Read Speeds


click to view full size image
Random Write Speeds


 
«  »
 
This article appeared in the November, 2006 issue of Atomic.

Behind the scenes with Mass Effect 3! GTX 560 VGA round-up! Essential Skyrim tweaks to improve your game! Plus reviews, news, hardware, more games, and easy to following modding guides for PC builders. ON SALE NOW!
 
Latest Competitions
 
Atomic Magazine

Issue: 133 | February, 2012

Atomic is a magazine aimed squarely at computer enthusiasts, gamers, and serious PC upgraders.

Every month we bring you the latest reviews of new technology and PC components, in depth features on everything from overclocking to console hacking, and gaming previews and interviews.
 
Latest Comments
 
Latest User Reviews
Battlefield 3 is the new benchmark online FPS
90%
A very fun and realistic multiplayer ride.
 
Antec Kuhler 920 - liquid cool
90%
Antec Kuhler 920 silent but effientive out of the box no maintence water cooling kit
 
Antec's Lanboy Air - our new favourite case
90%
Antec Lan boy Air in red a very cool design
 
Antec's Lanboy Air - our new favourite case
90%
This product overall is awesome.
 
MSI's GT780 laptop as fast as it gets
90%
Nice laptop
 
 
Close Get the February, 2012 issue of Atomic mailed to you for $8.95, including postage.

Buy nowDigital Version