Com base no código-fonte , ("limpo" ou "ativo") e ("degraded" ou "") e ("" ou "ressincronização" ou "recuperação") e ("" ou "Não iniciado").
if (array.raid_disks)
printf(" State : %s%s%s%s\n",
(array.state&(1<<MD_SB_CLEAN))?"clean":"active",
array.active_disks < array.raid_disks? ", degraded":"",
(!e || e->percent < 0) ? "" :
(e->resync) ? ", resyncing": ", recovering",
larray_size ? "": ", Not Started");
Você não perguntou sobre disk.state
, mas aqui está o código-fonte relevante:
if (disk.state & (1<<MD_DISK_FAULTY)) {
printf(" faulty");
if (disk.raid_disk < array.raid_disks &&
disk.raid_disk >= 0)
failed++;
}
if (disk.state & (1<<MD_DISK_ACTIVE)) printf(" active");
if (disk.state & (1<<MD_DISK_SYNC)) printf(" sync");
if (disk.state & (1<<MD_DISK_REMOVED)) printf(" removed");
if (disk.state & (1<<MD_DISK_WRITEMOSTLY)) printf(" writemostly");
if ((disk.state &
((1<<MD_DISK_ACTIVE)|(1<<MD_DISK_SYNC)|(1<<MD_DISK_REMOVED)))
== 0) {
printf(" spare");
if (is_26) {
if (disk.raid_disk < array.raid_disks && disk.raid_disk >= 0)
printf(" rebuilding");
} else if (is_rebuilding && failed) {
/* Taking a bit of a risk here, we remove the
* device from the array, and then put it back.
* If this fails, we are rebuilding
*/
int err = ioctl(fd, HOT_REMOVE_DISK, makedev(disk.major, disk.minor));
if (err == 0) ioctl(fd, HOT_ADD_DISK, makedev(disk.major, disk.minor));
if (err && errno == EBUSY)
printf(" rebuilding");