Can I setup a software RAID in Windows 7 using Virtual Hard Disks?

15

6

Well, the title of my question pretty much sums it up, but let me elaborate. The main idea of what I want to do is as follows:

1) I have two separate hard disks, with nearly equal performance. I use them as "basic" discs (contrast to "windows dynamic disks"), and intend to keep them that way for numerous reasons.

2) However, sometimes I want to use some advantages of Software RAID, that dynamic disks offer.

3) Windows 7, after just some 15 years now, finally caught up with Linux (and its "loop devices") and introduced a notion of "virtual hard disk", which is really a file on a real hard disk.

4) So, I wanted to create two virtual hard disk files on my two different hard disks, make them dynamic, format them, and finally join into one, for example, striped volume (aka RAID 0). This way my real hard drives stay "basic", and I get all advantages of "dynamic".

It looked like a nice idea to me, with no indication, that it might not work, yet it failed. Turns out, even though you can make dynamic virtual hard drives, you can't join them into RAID for no apparent reason (relevant menu items in Disk Management are grayed out).

Microsoft says

You cannot configure two attached VHDs to be a dynamically expanding VHD. A dynamically expanding VHD is a physical disk that you have initialized for dynamic storage. It contains dynamic volumes such as simple, spanned, striped, or mirrored volumes or RAID-5 volumes.

i.e "It can't be done, because it can't be done, so get lost now."

I guess, I can find another ways to achieve what I want (i.e software raid without making my discs dynamic). But I want to make it without using third-party tools and drivers, in a fully "system-supported" way.

Therefore, the question is: Does anyone know some kind of not-very-dirty hack to make it work?

nightingale

Posted 2010-03-06T19:53:01.147

Reputation: 331

1+1, good question. I can see myself possibly using this as well, but you might want to extend the question to allow for alternative disk formats (i.e. not only the VHD format). – Breakthrough – 2011-08-31T14:06:25.783

1What I want to know is how Disk Management knows that it is a virtual disk to treat it differently. Getting it to appear as a regular disk would be one way to fix it. +1 I hate stupid limitations like this. – Chris Smith – 2011-08-31T14:45:25.707

1That MS quote is kind of whacked. There seems to be confusion between Dynamically Expanding VHDs, and a drive prepared as a Dynamic Volume. – Ƭᴇcʜιᴇ007 – 2011-09-02T13:38:46.533

1"dynamically expanding" : how about trying fixed-size VHDs ? – harrymc – 2011-09-02T16:22:33.380

1@harrymc - That was one of my questions as well (But I guess I never asked. ;) : Were you using fixed-size VHDs when trying this? – Ƭᴇcʜιᴇ007 – 2011-09-02T19:50:56.693

First let me say I'm not normally a Windows user, however, in Windows XP Professional there was a way to create a fixed size virtual disk and create a software RAID array. I used to join multiple 200GB drives together to have one big 1TB drive appearance in Windows. How to this? I can't remember. I haven't used Windows regularly in over a years. – C0D3M0NK3Y – 2011-09-03T03:45:54.533

Answers

5

I convert my comment to an answer, as the comment by @C0D3M0NK3Y confirms it.

Windows will not accept dynamic virtual disks in a RAID, but the comment by @C0D3M0NK3Y confirms that fixed-size disks used to work in XP Professional. There is therefore an excellent chance that fixed-size virtual disks will still work with RAID in Windows 7.

It is actually quite logical that Windows cannot create a RAID over dynamic disks whose size is unknown and can change at any moment.


EDIT/ADD:

Had to try it to see either way for sure, and it works (when using fixed-sized VHDs):

Host OS: Windows 7 Ultimate, with two "Basic" disks.

VM OS: Vista Ultimate.

Created two "fixed sized" VHD's of 500MB each, one on each of the host's physical disks, and attached them to the VM (as the 2nd and 3rd drives).

Initialized the new disks in the VM and then converted them to "Dynamic" disks (in Vista's Disk Management).

Then joined them together into a RAID0 (stripe):

Span in a VM

Volume Size

Worked like a charm, without any need to do anything 'weird'.

harrymc

Posted 2010-03-06T19:53:01.147

Reputation: 306 093

2I'm not sure how CodeMonkey's comments really confirm or deny anything to do with VHD's, as XP doesn't have anything inherent for creating or dealing with VHDs? Did you actually try it (yet)? :) – Ƭᴇcʜιᴇ007 – 2011-09-05T06:13:57.397

1@techie007: I didn't and won't try it, and he probably used a 3rd-party product. But it sounds very logical and so worth trying by the poster. And didn't you yourself just validated my answer? But why did you post it as a separate answer from mine ? – harrymc – 2011-09-05T07:27:34.367

I posted it as a separate answer because it was a tested answer of "Yes it works", vs. "It should logically work, and someone else says it worked for them once in XP" with no info on how they did it. If others agree, I'll happily axe my answer and move the contents into yours (or something). It's not like either of us need the bounty. ;) – Ƭᴇcʜιᴇ007 – 2011-09-05T07:34:19.380

@techie007: I am happy that my answer has inspired you to verify it for the benefit of the poster and the SU site. I leave any decision in your hands (if you decide to edit mine, you have my blessings). – harrymc – 2011-09-05T08:43:37.223

Well wanting to know the answer myself (from earlier), and the lack of anyone actually verifying it one way or the other is what 'inspired' me. :) I'll pull my gun faster next time. ;) – Ƭᴇcʜιᴇ007 – 2011-09-05T18:59:53.880

On my Windows 7 Ultimate SP1 I cannot create or convert fixed size VHD to dynamic disk format. The "convert to dynamic disk" menu option is greyed out for the VHD. I tried 2GB in size, if that matters. You cannot get any kind of software RAID without first converting into dynamic disks. – Denis Nikolaenko – 2011-09-05T20:39:17.763

Dynamic disks have prerequisites. This is for XP - I haven't managed to find the list for Windows 7. Are any of them unfulfilled for your computer ? What does @techie007 say about his computer ?

– harrymc – 2011-09-05T21:31:42.930

@techie007: I up-voted some other answers of yours that I liked, so you wouldn't feel left out. – harrymc – 2011-09-06T13:57:06.367

@Dennis That's kind of weird. I can't say for sure what is up with your setup (without knowing more about it). I didn't do anything more than the regular steps. Unfortunately I don't currently have a Windows 7 VM set up. – Ƭᴇcʜιᴇ007 – 2011-09-07T03:20:39.890

@techie007 I have tried in Windows 7 x64 SP1 VMware Workstation 7 VM with 1GB fixed size .vhd disk. Still greyed out... – Denis Nikolaenko – 2011-09-11T18:12:38.663

@techie007 Tried with the same setup but, with x86 VM. Same results. Menu option is greyed out. Tried diskpart utility. Its convert command also fails with "unsupported" error. No dice... – Denis Nikolaenko – 2011-09-11T18:33:01.277

@techie007 I have reread your description of the process several times. Blah! Are you attaching .vhd from your virtualization software? So that guest Vista sees them as "real" hard disks? – Denis Nikolaenko – 2011-09-11T20:27:09.057

I second that question by Dennis. My original question didn't include anything about using a third-party virtualization software. It's kinda obvious, that you can make a RAID this way, anyway. But it's a performance penalty in its own right, which kinda defeats the purpose. – nightingale – 2011-09-28T08:40:18.247

2Fixed size virtual hard disks don't work in Windows 7, unfortunately. It only works inside a VM, not outside. – William Lawn Stewart – 2012-01-22T00:12:51.263

0

There is a way to fool Windows into striping VHDs by using Storage Spaces. 1- Create a VHD in each hard (physical) drive, in my case 4 drives, 4 VHDs. 2- From Storage Spaces create 4 pools, with one VHD in each of them. (Windows 7,8, Windows Server 2008+) 3- Create 1 volume with simple (no resilience) in each pool 4- Now you will have 4 logical disks controlled by Microsoft Storage Spaces Controller. You can stripe all of them together.

I have screenshots but I'm unable to upload them as my reputation is not enough yet.

Tested and works for Windows 8.1 , I have seen increase in performance. Just did it for experiment though, maybe I can use like a scratch disk for photoshop, too risky to store data you might need later.

sdkks

Posted 2010-03-06T19:53:01.147

Reputation: 189

To improve the storage spaces answer... You don't have to do anything special as far as creating the vhds on separate drives. Simply create all your vhds, then launch storage spaces and bind them together. Then on boot do an automount of all the vhds used by the storage space - then storage space will happily come in to existence again. Works like a charm – Steve – 2014-11-17T21:00:15.217

I am trying this with Windows 10 storage space and it does not allow me to mirror disks, Has anyone tested this with windows 10 storage space? – Allan Xu – 2016-12-15T15:21:08.497