I need to check RAID configuration in Linux. How do you check your current software RAID configuration in a Linux-based server powered by RHEL/CentOS or Debian/Ubuntu Linux?

Introduction – Linux supports both software and hardware based RAID devices. This page shows how to check software-based RAID devices created from two or more real block devices (hard drives/partitions).

How to check current RAID configuration in Linux

RAID is an acronym for Redundant Array of Independent Disks. It is nothing but combined single virtual device created from disk drives or partitions. Some RAID levels include redundancy and so can survive some degree of device failure. Linux support following RAID devices:

  1. RAID0 (striping)
  2. RAID1 (mirroring)
  3. RAID4
  4. RAID5
  5. RAID6
  6. RAID10

Check RAID configuration in Linux

The /proc/mdstat is a special file that stores essential information about all presently active RAID devices. Type the following cat command:
cat /etc/mdadm.conf
cat /proc/mdstat
Linux check your current RAID configuration
From the above output, it is clear that I have RAID 10 viraul device made of 5 disk partitions as follows:

  • md125 – RAID device file name
  • active raid10 – RAID type
  • sde3[3] sdb3[2] sdc3[1] sdd3[4] sda3[0] – RAID 10 device named /dev/md125 made of five partitions (also known as “component device”)
  • [UUUUU] – Shows status of each device of raid member disk/partition. The “U” means the device is healthy and up/running. The “_” means the device is down or damaged

Reviewing RAID configuration in Linux

Want to determine whether a specific device is a RAID device or a component device, run:
# mdadm --query /dev/DEVICE
# mdadm --query /dev/md125
# mdadm --query /dev/md12{5,6,7}

/dev/md125: 1157.85GiB raid10 5 devices, 0 spares. Use mdadm --detail for more detail.
/dev/md126: 4.98GiB raid10 5 devices, 0 spares. Use mdadm --detail for more detail.
/dev/md127: 1281.00MiB raid10 5 devices, 0 spares. Use mdadm --detail for more detail.

Let us examine a RAID device called /dev/ in more details, execute the following command:
# mdadm --detail /dev/md125
How to check raid configuration in redhat Linux
Finally see info about component device named /dev/sdd3, run:
# mdadm --examine /dev/sdd3
Sample outputs:

/dev/sdd3: Magic : a92b4efc Version : 1.2 Feature Map : 0x1 Array UUID : 4afdd8e1:a827d278:b1613938:cdc0a6ef Name : localhost.localdomain:root Creation Time : Sun Jun 25 19:07:43 2017 Raid Level : raid10 Raid Devices : 5 Avail Dev Size : 971276288 (463.14 GiB 497.29 GB) Array Size : 1214095360 (1157.85 GiB 1243.23 GB) Data Offset : 262144 sectors Super Offset : 8 sectors Unused Space : before=262056 sectors, after=0 sectors State : clean Device UUID : b6d9043e:fc1c8b6e:e82f970f:edf597e9 Internal Bitmap : 8 sectors from superblock Update Time : Sat Dec 15 00:44:25 2018 Bad Block Log : 512 entries available at offset 72 sectors Checksum : 7c314cad - correct Events : 21001 Layout : near=2 Chunk Size : 512K Device Role : Active device 4 Array State : AAAAA ('A' == active, '.' == missing, 'R' == replacing)


See my previous tutorial for more info:

For more information on Linux RAID device, refer to this page.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.