Data layout on RAID-1 Array

GCon asked:

For the sake of this question, assume a RAID-1 array of two identical drives.

RAID-1 (Mirroring) stores an identical copy of the data on both drives.

How identical is the drive layout?

Are the drives sector-by-sector identical (logical) – Excluding possible raid metadata?

If not, I am assuming there needs to be layout data stored somewhere. Would this be on the raid controller itself, or possibly within the drives?

There was a (quite heated) discussion at work, between quite old software engineers and younger ones. Could this be something that has changed?

My answer:

There’s actually a standard for RAID on-disk data and metadata, and it’s called DDF (Disk Data Format). At this point most storage controllers are using it, though you should double check before you rely on it. Linux also has a mdraid (software RAID) mode which can read and write to DDF formatted arrays.

DDF does indeed specify that the data on each disk is identical in a RAID 1 mirror.

A VD with PRL=01 and RLQ=00 MUST have two and only two extents. Each extent MUST be equal to the size of the VD. Each block of the VD, virtual_block(x), MUST be duplicated on both extents at the same offset

A pointer to the metadata for the array is stored at the end of each physical disk, and the standard recommends that the metadata itself be stored next to it at the end of the disk.

The Anchor Header (see Section 5.5) for the DDF structure MUST be stored at the last logical block returned by either the ATA Identify Device or SCSI Read Capacity commands depending on the type of physical disk.

The DDF structure SHOULD be stored at the end of the physical disk next to the anchor header. Storing the DDF structure at the end of the physical disk allows the possibility of converting a single non-RAID physical disk to a RAID 1 configuration without shifting user data. Similarly, data on a member of a RAID 1 configuration with the DDF structure at the end can also be accessed using a non-RAID controller.

You can download the specification and use it in your further discussions with your coworkers if you wish.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.