From 2c096ebe4b8f38faf701286852dbfd5939cfee47 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 30 May 2012 13:08:39 +1000 Subject: [PATCH] Detail: show which 'set' each device in a RAID10 belongs to A RAID10 can be though of as having 2 sets of devices (if there are 2 copies and an even number of devices in total). With this patch "mdadm --detail" shows which 'set' each device belongs to - set-A or set-B. If there are more than 3 copies, there can be more than 3 sets. If the number of copies does not evenly divide the number of devices, there are not distinct 'sets' so none are reported. Signed-off-by: NeilBrown --- Detail.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Detail.c b/Detail.c index ae15846d..abe8e2f1 100644 --- a/Detail.c +++ b/Detail.c @@ -533,7 +533,19 @@ This is pretty boring failed++; } if (disk.state & (1<> 8) & 0xff; + int copies = nc*fc; + if (array.raid_disks % copies == 0 && copies <= 26) { + /* We can divide the devices into 'sets' */ + int set = disk.raid_disk % copies; + printf(" set-%c", set + 'A'); + } + } + } if (disk.state & (1<