I have a brand new PC dual booting out of a single SSD drive (win7+debian). I added a couple of 2T hd I want to use from both Win & Linux. My target is to have two separate RAID-1 arrays on four 1T partitions.

I started partitioning under Linux (/dev/sd[de][12]) and buliding the array there works as expected (using mdmadmin --create /dev/md0 --level=mirror --raid-devices=2 /dev/sd[de]2).

Unfortunately Win7 seems unable to use the "remaining" free partitions (/dev/sd[de]1): it accepts my inpud, but then chokes with "insufficient disk space on device". I tried also reducing the size of the partitons (some posts imply Win needs a 1MB "overhead" partition), but I was not able to make it work.

I then deleted all partitions and created "Volumes" on Win7 and also this works as advertised.

Unfortunately it creates 1T Volumes, but also creates two partitions: the "small 1MB" and another one spanning the rest of the disk; no space left for Linux array.

Can someone suggest a strategy to create two 1TB RAID-1 disk arrays on two 2TB physical disks, one to be used under Win7 and another under linux?

NOTE: Linux Array will be an LVM volume mainly devoted to XEN VMs storage, so mounting the Win Array (ntfs) under Linux is not an option, unfortunately.

migrated from serverfault.com Dec 28 '13 at 7:39

This question came from our site for system and network administrators.

  • Following Evan Anderson advice I was able to implement what needed. I used the standard tools (Disk Manager) to create a couple of RAW partitions (simply removing tick on "Format" box), no need to use command-line tools. These can be used directly with mdmadmin --create. Everything after that is standard Linux management. – MCon Dec 27 '13 at 9:21
  • Glad to hear it worked out well. – Evan Anderson Dec 27 '13 at 22:36

You're going to need Logical Disk Manager (LDM) support in your Linux distro to access Windows dynamic disks. It's necessary that these disks be configured as dynamic, in Windows, to create mirrored volumes.

Its unclear to me if Debian is compiling in LDM support into their kernels (not a Debian user, so I can't say). There is LDM support in the kernel. The kernel can query the LDM database on the disk and present the volumes in the "/dev" filesystem. There's nothing to stop you from creating an LDM volume and using Linux software RAID and a Linux-only filesystem on it.

Adjunct to the kernel driver, there is the libldm ldmtool tool that can query the LDM and present voumes through the device mapper. That might be an option for you, too.


Let me try to clarify. I'm not suggesting you abandon Linux software RAID. Your problem isn't w/ RAID-- it's w/ reading the partition table. What you do for RAID is orthogonal to this issue.

Your kernel is showing you an MBR-style partition table on those disks. You're seeing this in Linux because Windows has made them "dynamic" and has stored this partition table as a compatibility feature to OS's that can read MBR-style partition tables. There is free space on those disks but your Linux OS needs to interpret the LDM database in order to access that free space.

You can't have a mirrored volume in Windows w/o using dynamic disks (LDM partitions) to host the mirrored volume. You're stuck. If you want Windows RAID-1 these disks will have to have LDM-style partitions.

Therefore, to address volumes on a dynamic disk from Linux you will have to use an LDM compatibility layer. If you don't use a dynamic disk you don't get software RAID in Windows.

It's unclear to me what has happened w/ kernel LDM support in Linux. The code looks to have been added in years ago and should be stable. I'd guess you're going to need to build a custom kernel. Check the kernel configuration (grep "CONFIG_LDM_PARTITION" /boot/config-$(uname -r)) to see if "CONFIG_LDM_PARTITION" is set-- I'd guess its probably not.

Once you've got Linux reading the LDM partition table you absolutely can use Linux software RAID for volumes you've created in the LDM partition table. They're just block devices. To create the volumes to host the Linux software RAID, though, you may need to use the Windows diskpart tool (or possibly the ldmtool utility I linked to).

  • This is not exactly what I asked. If I understand correctly you mean I should use Win LDM in place of Linux Software RAID. I would like to avoid that since I'm using RAID for added security and LDM seems very new and probably not extensively tested (ldmtool is at version 0.2!). I will dig into it anyways. Thanks. – MCon Dec 27 '13 at 0:00
  • I dropped-on an edit to clarify. – Evan Anderson Dec 27 '13 at 0:50
  • It seems Linux sees LDM partitions ok (with debian Wheezy stock Kernel), but even ldmtool seems unable to create new dynamic partitions. I will try to create a couple of matching partitions under win and then reformat them under Linux to be used with mdmadm --create. I'm unsure how to change "partition type". I will report here success/failure for future reference. – MCon Dec 27 '13 at 1:00
  • Have a look here: technet.microsoft.com/en-us/library/cc766465(v=ws.10).aspx The diskpart command you're looking for is create volume simple. The Windows disk management tool should show a simple volume w/o any filesystem. – Evan Anderson Dec 27 '13 at 1:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.