How To Indentify RAID Arrays in Linux

One of the easiest ways to find if your Linux system has any RAID arrays currently in use is to view the contents of the /proc/mdstat file. It’s a file that will definitely be present on your Linux system even if you don’t have any actual RAIDs configured yet.

Empty mdstat configuration

This is how it will look on a system without RAID arrays configured:

greys@centos:~ $ cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
unused devices: <none>

/proc/mdstat showing configured RAID arrays

And here’s an example from a system which has a number of arrays configured:

[greys@s3 ~]$ cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md1 : active raid1 sdb1[1] sdc1[2] sda1[0]
10238912 blocks [3/3] [UUU]

md2 : active raid5 sdb2[1] sdc2[2] sda2[0]
280804352 blocks level 5, 512k chunk, algorithm 2 [3/3] [UUU]
bitmap: 1/2 pages [4KB], 65536KB chunk

md4 : active raid5 sdb4[1] sdc4[2] sda4[0]
10236928 blocks level 5, 512k chunk, algorithm 2 [3/3] [UUU]

unused devices: <none>

Understanding the /proc/mdstat

First line of the output says Personalities, and this tells you all the possible RAID configurations that your Linux kernel supports:

  • raid0 – striped volume
  • raid10
  • raid6
  • raid5
  • raid4
  • multipath – not really a RAID type but instead just support for additional paths (using fiber channel cards) to the same storage.

Next you will have active RAID arrays listed and documented, if there are any.

Here’s how to read a RAID configuration example:

md4 : active raid5 sdb4[1] sdc4[2] sda4[0]
10236928 blocks level 5, 512k chunk, algorithm 2 [3/3] [UUU]

This means:

  • md4 is the name of a RAID array device
  • RAID type is raid5
  • array consists of 3 devices (sdb4/sdc4/sda4)
  • RAID block size is 512K (this is different from your Linux I/O block size, but should be considered and configured together for best performance)
  • all 3 devices are up (that’s why it says [UUU]). if any of the disks would be missing or faulty, I believe it would show which one by replacing U with _ – so [U_U] would mean the second disk (probably sdc4) is down

That’s it for now! I’ll be posting a full tutorial on creating RAID arrays in Linux soon, so stay tuned! Leave a comment or join my Facebook group to ask questions.

See Also

Keep Learning

Follow me on Facebook, Twitter or Telegram:
I learn with Educative: Educative
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!

Recent Tweets