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:
- RAID0 (striping)
- RAID1 (mirroring)
- RAID4
- RAID5
- RAID6
- RAID10
- MULTIPATH
- FAULTY
- CONTAINER
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
Or
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:
/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
See my previous tutorial for more info:
- Linux Create Software RAID 1 (Mirror) Array
- 5 Tips To Speed Up Linux Software Raid Rebuilding And Re-syncing
- CentOS / Redhat: Create Software RAID 1 Array
For more information on Linux RAID device, refer to this page.
🐧 0 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |