Dymanic Disk – Fault Tolerant Volumes on XP (SP3)

This is a great article: Using Windows XP to Make RAID 5 Happen
Here is the important part: Windows XP has the ability to create/handle Mirrored, RAID 5 volumes, but it is “disabled”. There is a way to “enable” these features. This hack is described in the mentioned article.

In case it’s not available there:
you need to modify these 3 files:
C:\windows\system32\drivers\dmboot.sys

Before:
0000f1f0h: 74 00 54 00 79 00 70 00 65 00 00 00 57 49 4E 4E ; t.T.y.p.e…WINN
0000f200h: 54 00 00 00 53 45 52 56 45 52 4E 54 00 00 00 00 ; T…SERVERNT….
After:
0000f1f0h: 74 00 54 00 79 00 70 00 65 00 00 00 53 45 52 56 ; t.T.y.p.e…SERV
0000f200h: 45 52 4E 54 57 49 4E 4E 54 00 00 00 00 00 00 00 ; ERNTWINNT…..

C:\windows\system32\dmconfig.dll

Before
00005140h: 4C 41 4E 4D 41 4E 4E 54 00 00 00 00 53 45 52 56 ; LANMANNT….SERV
00005150h: 45 52 4E 54 00 00 00 00 57 49 4E 4E 54 00 00 00 ; ERNT….WINNT…
After
00005140h: 4C 41 4E 4D 41 4E 4E 54 00 00 00 00 57 49 4E 4E ; LANMANNT….WINN
00005150h: 54 00 00 00 00 00 00 00 53 45 52 56 45 52 4E 54 ; T…….SERVERNT

C:\windows\system32\Dmadmin.exe

Before
00001c30h: 73 65 72 76 65 72 6E 74 00 00 00 00 6C 61 6E 6D ; servernt….lanm
00001c40h: 61 6E 6E 74 00 00 00 00 50 72 6F 64 75 63 74 54 ; annt….ProductT
After
00001c30h: 77 69 6E 6E 74 00 00 00 00 00 00 00 6C 61 6E 6D ; winnt…….lanm
00001c40h: 61 6E 6E 74 00 00 00 00 50 72 6F 64 75 63 74 54 ; annt….ProductT

and copy a copy to C:\windows\system32\dllcache
But don’t forget about windows file protection, do this in safe mode, or form boot cd/usb…

Windows service pack 3 overwrites these files (2 of them anyway). So if you did this on SP2 and updated to SP3 after that you won’t be able to access mirrors, raid 5… The good news is this works on SP3 too, so all you need to do is reapply this “patch”. (A new windows update, or “security patch” might disable this feature in the future. But I think microsoft is concentrating on Vista these days)

Why is this good/useful anyway?
First of all, do you want to keep your data safe?
Let’s be clear, this alone won’t keep your data safe, this is just one step. You need external backup (possibly a location far away) too.
There is several reason for and against hardware raid. My top reasons against HW and for SW RAID is: HW change/compatibility/portability, completely custom raid volume sizes/disk sizes. (but RAID 5 is slow on SW raid)
Well if you do not have windows 2003, but you want to keep your data on SW RAID, this might be your solution.
Personally I do have a win2k3, but only one. And if it’s not working for some reason I want to be able to get to my data fast from a second computer (win XP running on it). I don’t use raid on my backup xp, but I might need it someday…

Dynamic Disk Group Name vs. ID

Today I had another encounter with dynamic disks. I recently removed 4 disk from my computer and replaced them. Now I have 4 spare disk and I plan to use them for backup purposes. I put the first disk in a PC (running XP) and started the Disk management console. I imported the foreign disk, everything went well… I removed the first and put in the second disk, this time I did not have to import it. I did not need to import the third one either. Than I put in the 4th, but now I cannot import this dynamic disk. In the Event Viewer it says:
LDM – INTERNAL Error – A disk group with the specified name already exists (C100007A).

The next part is For Experts only! Backup your data! You’ve been warned!
Lets start with the tools:
You can find some useful utils on the windows install cd (who would have thought :)) \support\tools\suptools.msi

To generate detailed information on your dynamic disk configuration run:
\Program Files\Support Tools\dmdiag.exe -v >> disk.log

Here is parts of the result for disk #3:

———- Dynamic Disk Information ———–
DiskGroup: FotonDg0
Group-ID: 7*******-****-****-****-************

———- LDM Disk Header Harddisk1 ———-
diskid: 1xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
group: name=FotonDg0 id=7*******-****-****-****-************
flags: private autoimport
import: bootsig=4iiiiiiii hostid=hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh
diskset: id=6sssssss-ssss-ssss-ssss-ssssssssssss new=asssssss-ssss-ssss-ssss-ssssssssssss

———- LDM Disk Config Harddisk1 ———-
#dgname: FotonDg0 dgid: 7*******-****-****-****-************

For Disk #4:

———- Dynamic Disk Information ———–
DiskGroup: FotonDg0
Group-ID: 2*******-****-****-****-************

———- LDM Disk Header Harddisk1 ———-
diskid: axxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
group: name=FotonDg0 id=2*******-****-****-****-************
flags: private autoimport
import: bootsig=1iiiiiiiii hostid=hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh
diskset: id=fsssssss-ssss-ssss-ssss-ssssssssssss

———- LDM Disk Config Harddisk1 ———-
#dgname: FotonDg0 dgid: 2*******-****-****-****-************

The hostid and the group name is the same for both disks.
It seems I have multiple disk group id for the same disk group name.
How this happened I don’t know, but not really the question either. The Question is how to fix it.

First of all, at the moment this is the only dynamic disk connected to the PC, so it shouldn’t be a problem importing it (except it is). The problem is that windows stored the first diskgroup id in somewhere the registry. I suspect HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmio\Boot Info\Primary Disk Group. Since I have the ID at hand (saved dmdiag log) lets search for it. …searching… Deleting this key, (or modifying to the 4th disk’s group ID) should fix this problem. (reboot might be required) (search done: HKEY_LOCAL_MACHINE\SYSTEM\ControlSet*\Services\dmio\Boot Info\Primary Disk Group were the only places.)

But what if I want to use both disk (with different disk group ID) together? How can I fix the disk group ID mismatch / same name? What’s the right way? How Can I edit the disk group name and/or ID ? If I manage to rename the disk group, will windows handle multiple disk groups?
Well I don’t have the answers for these questions (yet) 🙁

In a disk group each and every disk has a copy of configuration data of all disks and volumes in that group. Modifying completely different disk groups to the same name and id is probably not a good idea, since both have completely different configuration data on them. I’m not sure how would the windows deal with the conflict. Conflict in the configuration data may occur even if the disks were in the same group at some point of time. for example if a disk is removed from the system, and then new volumes were created or removed… That’s why I imported every disk separately.

Since I plan to convert all these disks to basic disks I don’t really need to care, but it would be nice to know these things for future reference. My advice is do not separate dynamic disks from the group,(and do not rejoin them later,) move them together. (Or do not use them at all, at least not for mobile data storage)

Here is some info on Dynamic Disks
Best practices for using dynamic disks on Windows 2000-based computers
Description of Disk Groups in Windows Disk Management

Here is an other useful tool: diskpart
for example to wipe your hdd clean with diskpart:
>diskpart
select disk 1
detail disk
clean all !!! do NOT do this unless you are absolutely sure
(This does not provide complete data destruction. It might be possible to read your data with special hardware based on electromagnetic residue)