Skip to content
jc-rs
GitHub

mdadm

--mdadmv1.0.0

Converts `mdadm` command output to JSON

Linuxcommand
$ mdadm | jc-rs --mdadm

A real pair

From the reference corpus (generic/mdadm-query-container1-root.json). The left pane is the input the fixture ships; the right pane is the corpus's expected JSON. CI compares jc-rs with it field by field under the published differential. Hover a value to see where it came from.

mdadmgeneric
/dev/md0:
           Version : ddf
        Raid Level : container
     Total Devices : 2

   Working Devices : 2

    Container GUID : 4C696E75:782D4D44:DEADBEEF:00000000:502D01BA:FB6D4FCB
                  (Linux-MD 08/16/22 16:20:42)
               Seq : 00000008
     Virtual Disks : 1

     Member Arrays : /dev/md/vol0

    Number   Major   Minor   RaidDevice

       -     254        0        -        /dev/vda
       -     254       16        -        /dev/vdb
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
{
  "device": "/dev/md0",
  "version": "ddf",
  "raid_level": "container",
  "total_devices": 2,
  "working_devices": 2,
  "container_guid": "4C696E75:782D4D44:DEADBEEF:00000000:502D01BA:FB6D4FCB",
  "seq": "00000008",
  "virtual_disks": 1,
  "member_arrays": "/dev/md/vol0",
  "device_table": [
    {
      "number": null,
      "major": 254,
      "minor": 0,
      "device": "/dev/vda",
      "raid_device": null
    },
    {
      "number": null,
      "major": 254,
      "minor": 16,
      "device": "/dev/vdb",
      "raid_device": null
    }
  ],
  "member_arrays_list": [
    "/dev/md/vol0"
  ]
}

Fixture coverage

40/40oracle-valid pairs match under the published structural JSON comparison

Magic syntax

jc-rs mdadmjc-rs runs the command itself and parses what it prints. Recognised for: `mdadm`

Source: crates/jc-rs-parsers/src/disk/mdadm.rs. jc-rs targets the schemas defined by the original Python tool. Fixture coverage above is the measured evidence for this parser; test the inputs your pipeline depends on. Compare