How to check RAID configuration in Linux

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

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

Finally see info about component device named /dev/sdd3, run:
# mdadm --examine /dev/sdd3
Sample outputs:

          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.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum