(original article)

Querying RAID10 layout and geometry

09 November 2010, 18:36 UTC

I have 6 drives as RAID10, and want to send both /dev/sde and /dev/sdf back to be replaced, so I just want to know the real layout of the array to know if it'll still run without these until the new ones arrive.

I've used mdadm on fc12-14 for a year, hotswapped a couple of failed drive and got the hang of its quirks.

After much research and digging I found something in the man page under the -p option which seems to me rather obscure. The default creation layout is the undefined term 'left-symmetric' and default layout is 'n2', which says in the man: "Multiple copies of one data block are at similar offsets in different devices."

But which devices???

mdadm --detail does not help me know which devices are pairs, and which I can pull out and while keeping the array running, nor does the man page explain it clearly.

mdadm --detail /dev/md0 /dev/md0: Version : 0.90 Creation Time : Tue Jan 19 02:43:36 2010 Raid Level : raid10 Array Size : 2197714752 (2095.90 GiB 2250.46 GB) Used Dev Size : 732571584 (698.63 GiB 750.15 GB) Raid Devices : 6 Total Devices : 6 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Tue Nov 9 18:30:57 2010 State : clean Active Devices : 6 Working Devices : 6 Failed Devices : 0 Spare Devices : 0 Layout : near=2 Chunk Size : 64K UUID : 8ae77b89:72492206:bfe78010:bc810f04 Events : 0.10143148 Number Major Minor RaidDevice State 0 8 1 0 active sync /dev/sda1 1 8 17 1 active sync /dev/sdb1 2 8 33 2 active sync /dev/sdc1 3 8 49 3 active sync /dev/sdd1 4 8 65 4 active sync /dev/sde1 5 8 81 5 active sync /dev/sdf1 So which devices are pairs? This 'detail' doesn't tell me anything without some missing assumptions!

{ab}{cd}{ef} or {ad}{be}{cf} or something else? I assume 3 stripes, but it could even be 3 mirrors of 2way stripes!

Could not the --detail option not make a better picture of an array's organisation? for example: a b c stripeset 0 {sda1} {sdb1} {sdc1} stripeset 1 {sdd1} {sde1} {sdf1} or a b stripeset 0 {sda1} {sdb1} stripeset 1 {sdc1} {sdd1} stripeset 2 {sde1} {sdf1} What about other exotic layouts, like mirrored raid5/6 a b c d e stripeset 0 {sda1} {sdb1} {sdc1} {sdd1} {sde1} stripeset 1 {sdf1} {sdg1} {sdh1} {sdi1} {sdj1} or 4 mirrors of raid5 a b c stripeset 0 {sda1} {sdb1} {sdc1} stripeset 1 {sdd1} {sde1} {sdf1} stripeset 2 {sdg1} {sdh1} {sdi1} stripeset 3 {sdj1} {sdk1} {sdl1} This method would help me a lot to visualise what devices are where.