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:

[email protected]:~ $ 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:

[[email protected] ~]$ 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 with Me

Follow me on Facebook and Twitter or jump into Telegram chat!:
Recommended Software
I use Brave browser, it's awesome: Brave Browser I'm also a fan of SetApp for macOS: SetApp for macOS
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 Articles
18 Jun 2021

CentOS 8.4 Released

17 Jun 2021

yum/dnf Package Manager Basics

07 Jun 2021


Recent Tweets