/proc/mdstat is a special file that shows you the state of the Linux kernel’s md driver. md (multiple device) driver is the software RAID implementation that allows you to create any number of RAID devices based on the disk devices (physical or virtual) available to your Linux system.
Simply cat /proc/mdstat file to get the summary of configuration:
The first line of the output confirms all the software RAID levels supported by your md driver
Usually starting with md0 or md127, these devices (md0, md1, md2 and md3 in the output above) are the actual RAID arrays configured. Each of these devices (if healthy) is presented as a single storage device that you can format, mount, etc.
After the name of an md device, you see the status (active means it’s online and healthy) of your array and the list of devices that belong to that array.
This above is the output from my 8-bay Synology NAS server, so I have 8 disks in each software RAID device.
IMPORTANT: you don’t need to use full devices when adding them to a RAID array. You can always partition each physical disk, and then create different RAID arrays using different partitions. That’s exactly what you can see in the output above: Synology has “only” 8 physical disks, but each is partitioned so m23 is created using partition 6 (sdh6 ,sda6, etc), md2 is using partitions 5 (sdh5, sda5, etc) while md1 users partition 2 (sdh2, sda2) and md0 uses partitions with number 1 on each of the physical disks.
For each md device you get the raid personality confirmed (raid6 or raid1 after the “active” status word for each mdX device).