How to list which drives are part of each RAID array

mdadmraidsoftware-raid

I have a linux software RAID using md. I want to list all of my RAID arrays and each hard drive attached to them. Is there an easy way to do that?

Best Answer

cat /proc/mdstat will give you the output you need, relatively easy to parse, because the mapped device is on the same line as its members, e.g.:

$ cat /proc/mdstat 

Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [linear] [multipath] 
md0 : active raid1 sdf2[1] sde2[0]
      81854336 blocks super 1.2 [2/2] [UU]

md127 : active raid0 sdf3[1] sde3[0]
      286718976 blocks super 1.2 512k chunks

unused devices: <none>
Related Topic