Array member "role numbers" in /proc/mdstat
https://raid.wiki.kernel.org/index.php/Mdstat says that the number shown in square brackets after each component device is the role number, but this does not appear to be true (at least not always):
[root@c6 ~]# mdadm -C /dev/md0 -l 5 -n 3 -x 1 /dev/sd[bcde]
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
[root@c6 ~]# cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4] [raid10] md0 : active raid5 sdd[4] sde[3](S) sdc[1] sdb[0]
4191232 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
[root@c6 ~]# mdadm --detail /dev/md0/dev/md0:
Version : 1.2
Creation Time : Mon Sep 23 10:54:59 2013
Raid Level : raid5
Array Size : 4191232 (4.00 GiB 4.29 GB)
Used Dev Size : 2095616 (2046.84 MiB 2145.91 MB)
Raid Devices : 3
Total Devices : 4
Persistence : Superblock is persistent
Update Time : Mon Sep 23 10:56:13 2013
State : clean
Active Devices : 3
Working Devices : 4
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 512K
Name : c6.penurio.us:0 (local to host c6.penurio.us) UUID : 17b42cb3:691ea02a:1d9822a1:6be0b398
Events : 18
Number Major Minor RaidDevice State
0 8 16 0 active sync /dev/sdb
1 8 32 1 active sync /dev/sdc
4 8 48 2 active sync /dev/sdd
3 8 64 - spare /dev/sde
Doc bug?
Signature · 4 lines
======================================================================== Ian Pilcher [email protected] Sometimes there's nothing left to do but crash and burn...or die trying. ========================================================================
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines · Benjamin ESTRABAUD
Are you referring to the particular mention"Any device with "n" or higher are spare disks. 0,1,..,n-1 are for the working array." in the Mdstat wiki page?
I was really thinking of the sentence before that, which states:
The raid role numbers [#] following each device indicate its role, or function, within the raid set.
Signature · 4 lines
======================================================================== Ian Pilcher [email protected] Sometimes there's nothing left to do but crash and burn...or die trying. ========================================================================
Quoted 9 lines · Ian Pilcher
Quoted 3 lines · Benjamin ESTRABAUD
Are you referring to the particular mention"Any device with "n" or higher are spare disks. 0,1,..,n-1 are for the working array." in the Mdstat wiki page?
I was really thinking of the sentence before that, which states:
The raid role numbers [#] following each device indicate its role, or function, within the raid set.
The wiki is wrong. The number in brackets is the device's index into the *table* of roles in the superblock. In a new array, table entries are allocated sequentially, which makes it *look* like the role numbers.
Phil