MDRAID Sysfs Components

The MDRAID subsystem has sysfs components that provide information or can be used to tweak behavior and performance. All MDRAID devices present in the system are shown in /sys/block/.

Example:

# ls -l /sys/block/md*
lrwxrwxrwx 1 root root 0 May 17 13:26 /sys/block/md126 -> ../devices/virtual/block/md126
lrwxrwxrwx 1 root root 0 May 17 13:26 /sys/block/md127 -> ../devices/virtual/block/md127

Mapping between a device number and its name can be found as shown below:

# ls -l /dev/md/ total 0

lrwxrwxrwx 1 root root 8 May 17 13:26 imsm0 -> ../md127

lrwxrwxrwx 1 root root 8 May 17 13:26 raid1 -> ../md126

# ls -l /dev/md/ total 0
lrwxrwxrwx 1 root root 8 May 17 13:26 imsm0 -> ../md127
lrwxrwxrwx 1 root root 8 May 17 13:26 raid1 -> ../md126

Note: md127 is imsm0 and md126 is raid1.

MD devices in /sys/block are symbolic links pointing to /sys/devices/virtual/block. All MD devices are in the md subdirectory in the /sys/devices/virtual/block/mdXYZ directory. In the md directory the following contents can be found:

Since the MD device is a container, the metadata version file will show:

The directory contains subdirectories dev-nvme1n1 and dev-nvme2n1 specifying the disks that the container is assembled from.

The MD volume contents look like below:

Several new files are present, and they are related to the RAID volume properties. Base information can be read from the following files:

Array size:

Array state:

Raid level:

Strip size:

Metadata:

And this is what is shown in the /proc/mdstat file for the example RAID information:

Last updated

Was this helpful?