How To Check the RAID configuration on Linux

In this article, we want to teach you How To Check the RAID configuration on Linux.

RAID (redundant array of independent disks) is a way of storing the same data in different places on multiple hard disks or solid-state drives (SSDs) to protect data in the case of a drive failure.

RAID-systems can be used with a number of interfaces, including SATA, SCSI, IDE, or FC (fiber channel.) There are systems that use SATA disks internally, but that have a FireWire or SCSI interface for the host system.

There are different RAID levels, however, and not all have the goal of providing redundancy.

Linux support following RAID devices:

  1. RAID0 (striping)
  2. RAID1 (mirroring)
  3. RAID4
  4. RAID5
  5. RAID6
  6. RAID10
  7. MULTIPATH
  8. FAULTY
  9. CONTAINER

Check the RAID configuration on Linux

At this point, we want to show you how to use Linux commands to check the RAID configuration.

There is a directory named /proc/mdstat that stores essential information about all active RAID devices.

Use the cat command to see the file:

cat /proc/mdstat

Or you can use the following command:

cat /etc/mdadm.conf

The mdadm is a Linux utility used to manage and monitor software RAID devices.

It is used in modern Linux distributions in place of older software RAID utilities such as raidtools2 or raidtools.

The main purpose of mdadm command is to combine one or more physical disk drive components into one or more logical units.

Mdadm command can be used in the below way:

mdadm [mode] <raiddevice> [options] <component-devices>

To find out a specific device is a RAID device or a component device, you can use the mdadm command, for example:

# mdadm --query /dev/DEVICE
# mdadm --query /dev/md125
# mdadm --query /dev/md12{5,6,7}
Output
/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.

You can examine a RAID device in more detail, with the following command, for example:

mdadm --examine /dev/sdd3
Output
/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)

Conclusion

At this point, you learn to Check the RAID configuration on Linux.

Hope you enjoy it.

May you will be interested in these articles:

How To Find Hard Disk Information on Linux.

How To Create a New Disk on Linux.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

POPULAR TAGS

Most Popular