How to implement software RAID0?

I think this should be implemented first by creating a virtual disk, and then attach 2 physical disks to the virtual disk.

How can I tell the OS that the 2 physical disks are attached to the virtual disk and set up a RAID0?

Is there any system calls that I can use or I need a filter driver to filter certain commands?

Thanks

Is it an exercise, or for a product? Note that Windows already supports RAID0.

You need to claim the disks in your driver, so nobody else mounts to them, and expose your disk PDO instead.

“Multa cadunt inter calicem supremaque labra.”

Peter
OSR

On 12/03/2012 15:46, xxxxx@broadcom.com wrote:

Is it an exercise, or for a product? Note that Windows already supports RAID0.

You need to claim the disks in your driver, so nobody else mounts to them, and expose your disk PDO instead.

To expand on that. Windows assumes that disks with partition table
entries that offer certain partition types automatically belong to
Windows i.e. various DOS types and NTFS. You need to maintain your own
partition table with non-standard types on these disks if you are to
stop Windows claiming those disks and to be able to claim them for yourself.

It is an exercise and I am learning the stuff about storage related drivers.

How can I claim the disks in my driver to pverent others to mount them?

Does the ‘expose your disk PDO instead’ means the PDO of the virtual disk?

Thanks

2012/3/12

> Is it an exercise, or for a product? Note that Windows already supports
> RAID0.
>
> You need to claim the disks in your driver, so nobody else mounts to them,
> and expose your disk PDO instead.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Does it means that I should write my own file system?

2012/3/13 Mark S. Edwards

> On 12/03/2012 15:46, xxxxx@broadcom.com wrote:
>
>> Is it an exercise, or for a product? Note that Windows already supports
>> RAID0.
>>
>> You need to claim the disks in your driver, so nobody else mounts to
>> them, and expose your disk PDO instead.
>>
>>
>>
>>
> To expand on that. Windows assumes that disks with partition table
> entries that offer certain partition types automatically belong to Windows
> i.e. various DOS types and NTFS. You need to maintain your own partition
> table with non-standard types on these disks if you are to stop Windows
> claiming those disks and to be able to claim them for yourself.
>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.**cfm?name=ListServerhttp:
></http:>

Ah! Well then. In that case, I’d DEFINITELY write a file system.

Peter
OSR

2012/3/13

>


>
> Ah! Well then. In that case, I’d DEFINITELY write a file system.
>
> Peter
> OSR
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

That is really far more complex than I expected, writing a file system is
not a easy job.

Is there any other simpler way?

Hmmm… I think you may have been lead astray here. Windows implements
volume mirrors, which is one form of a software raid 0, but not really
raid 0 in its strict sense as that applies to disks, not volumes.

You can implement software raid 0 for disks, and it does not require
new partition types, nor a filesystem. It does require a design very
much in line with your original assertion that you need a virtual disk
that controls a pair of physical disks.

To do this you need a bus filter driver on top of the storage adapter
(scsi/stor/ahci) to hide and control all of the disk pdos enumerated
by those devices that you intend to mirror, and a virtual hba on top
of that that enumerates virtual disk PDOs.

The code is left as an exercise for the reader…

Mark Roddy

On Mon, Mar 12, 2012 at 11:37 PM, Andrew wrote:
>
>
> 2012/3/13
>
>>


>>
>> Ah! ?Well then. ?In that case, I’d DEFINITELY write a file system.
>>
>> Peter
>> OSR
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>
>
>
> That is really far more complex than I expected, writing a file system is
> not a easy job.
>
> Is there any other simpler way?
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the
> List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

RAID0 is a stripe, R1 is a mirror.

Mark Roddy wrote:

Hmmm… I think you may have been lead astray here. Windows implements
volume mirrors, which is one form of a software raid 0, but not really
raid 0 in its strict sense as that applies to disks, not volumes.


Kind regards, Dejan (MSN support: xxxxx@alfasp.com)
http://www.alfasp.com
File system audit, security and encryption kits.

OK, OK… I must apologize. My attempt at sarcasm went undetected by the OP. My fault. My bad. Mea culpa.

My POINT was, if what you want to do is an EXERCISE, you can certainly write a file system. That doesn’t make any SENSE from the point of view of creating a PRODUCT… but neither does trying to implement software RAID 0 on the existing Windows storage stack.

So, you know… why not just go ahead and write a file system.

I am increasingly frustrated with people posting questions regarding pointless goals, impractical implementations, and unreasonable constraints… which causes people on the list including myself to work hard to TRY help these people solve a real problem… and later to discover that the OP is merely seeking amusement in the form of “research” or “an exercise.”

My problem. My bad. My apologies.

Good luck with your “exercise”,

Peter
OSR

Either way the same answer. You can stripe or mirror disks, not
volumes, and you can do so without writing a filesystem.

Mark Roddy

On Tue, Mar 13, 2012 at 10:09 AM, Dejan Maksimovic wrote:
>
> ? ?RAID0 is a stripe, R1 is a mirror.
>
> Mark Roddy wrote:
>
>> Hmmm… I think you may have been lead astray here. Windows implements
>> volume mirrors, which is one form of a software raid 0, but not really
>> raid 0 in its strict sense as that applies to disks, not volumes.
>
> –
> Kind regards, Dejan (MSN support: xxxxx@alfasp.com)
> http://www.alfasp.com
> File system audit, security and encryption kits.
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

>RAID0 is a stripe, R1 is a mirror.
Ok, I think Windows also implements a form of this as well. I believe with GPT drives a ‘volume’ can span multiple partitions. While not the same thing as striping at the drive level, the end effect is you get a volume that is the sum of the sizes of the underlying partitions. or something like that. Cheers,Dave Cattley

>Ok, I think Windows also implements a form of this as well. I believe with GPT drives a ‘volume’ can

span multiple partitions

With Dynamic Disks only.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Easiest way is to write a miniport.