Skip to content

It is possible to return "State"?  #3

@gassanpavel

Description

@gassanpavel

Hi, looks like mdstat.parse() dont parse "State" field from mdadm --detail [md device]
Its will be wery helpfull to understand when whole MD device are failed or degraded in addition to disks state

/dev/md0:
           Version : 1.2
     Creation Time : Wed Jan 22 11:06:35 2020
        Raid Level : raid6
        Array Size : 134119424 (127.91 GiB 137.34 GB)
     Used Dev Size : 16764928 (15.99 GiB 17.17 GB)
      Raid Devices : 10
     Total Devices : 11
       Persistence : Superblock is persistent

       Update Time : Wed Jan 22 13:35:51 2020
             State : clean, degraded 
    Active Devices : 9
   Working Devices : 9
    Failed Devices : 2
     Spare Devices : 0

            Layout : left-symmetric
        Chunk Size : 4096K

Consistency Policy : resync

              Name : test:0  (local to host test)
              UUID : 10df35c4:9fa5a110:e6143371:e68c3c11
            Events : 64

    Number   Major   Minor   RaidDevice State
       0       8       17        0      active sync   /dev/sdb1
       1       8       33        1      active sync   /dev/sdc1
       2       8       49        2      active sync   /dev/sdd1
      10       8      177        3      active sync   /dev/sdl1
       4       8       81        4      active sync   /dev/sdf1
       5       8       97        5      active sync   /dev/sdg1
      11       8      193        6      active sync   /dev/sdm1
       -       0        0        7      removed
       8       8      145        8      active sync   /dev/sdj1
       9       8      161        9      active sync   /dev/sdk1

       6       8      113        -      faulty   /dev/sdh1
       7       8      129        -      faulty   /dev/sdi1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions