Checking and monitoring software RAID status (Linux)
Please use the “Print” function at the bottom of the page to create a PDF.
Valid for Dedicated Servers and Bare Metal Servers running Linux.
In this article, you will learn how to check and monitor the status of a software RAID on a Dedicated Server or Bare Metal Server with a Linux operating system. This is essential for responding immediately if a drive fails.
Check the software RAID status
- Log in to the server as an administrator (root).
To check the status of the software RAID, enter the following command:
[root@localhost ~]# cat /proc/mdstat
Status with an intact RAID
If all drives are correctly integrated, the output will look like this:
Dedicated Server with 2 SSDs and RAID 1
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md2 : active raid1 sda3[1] sdb3[0]
262016 blocks [2/2] [UU]
md1 : active raid1 sda2[1] sdb2[0]
119684160 blocks [2/2] [UU]
md0 : active raid1 sda1[1] sdb1[0]
102208 blocks [2/2] [UU]
unused devices: <none>
This example shows three RAID devices (md0, md1, md2). At the end of the line for each md device, the status of the RAID arrays is displayed in square brackets.
[2/2] means: 2 out of 2 devices are active. Each U stands for a device in the "Up" (functional) state.
Dedicated Server with 2 SSDs, 4 hard drives, and RAID 5
Personalities: [raid1] [raid5]
md127: active raid1 sda2[0] sdd2[1]
1428416 blocks super 1.0 [2/2] [UU]
md11 : active raid5 sdb1[1] sde1[0] sdc1[2] sdf1[3]
23442074112 blocks super 1.0 level 5, 512k chunk [4/4] [UUUU]
This example shows the RAID devices md127 (RAID 1) and md11 (RAID 5).
[2/2] or [4/4]: Indicates how many drives are designated for the array and how many of them are active.
[UU]: Each U stands for "Up" (functional). A RAID 5 with four hard drives consequently shows [UUUU].
Status in case of a defective or missing drive
If a drive has failed or is missing, the display changes:
Dedicated Server with 2 SSDs and RAID 1
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 sda1[1]
102208 blocks [2/1] [U_]
md2 : active raid1 sda3[1]
262016 blocks [2/1] [U_]
md1 : active raid1 sda2[1]
119684160 blocks [2/1] [U_]
unused devices: <none>
Dedicated Server with 2 SSDs, 3 hard drives, and RAID 5
md127 : active raid1 sda2[0]
1428416 blocks super 1.0 [2/1] [U_]
The _ symbol in the [U_] entry indicates that a device in the array is missing or faulty. [2/1] indicates that only one of the two devices is still active. In this case, urgent action is required. If necessary, contact IONOS Customer Support for a hardware replacement.
Displaying details of a RAID device
To view more details about a RAID device, use the mdadm command. This is necessary, for example, if you need to know exactly which physical hard drive is defective.
For a deeper analysis of a specific array, use the command mdadm -D /dev/md1.
Adapt the following command and enter it:
[root@localhost ~]# mdadm -D /dev/mdX
Example:
[root@localhost ~]# mdadm -D /dev/md127
- Pay close attention to the following lines in the output:
State: A healthy RAID is displayed as clean. Critical states are degraded or dirty.
- Active Devices / Working Devices: Should match the number of RAID devices.
- Failed Devices: Shows the number of defective drives.
- RaidDevice State: Displays the state of individual partitions (e.g., /dev/sda1). The status active sync means synchronized, while faulty or removed indicates a defect.
- Rebuild Status: If you have just replaced a drive, the rebuilding progress will be shown here in percent.
Examples of a functioning RAID:
Dedicated Server with 2 SSDs and RAID 1
[root@localhost ~]#mdadm -D /dev/md1
/dev/md1:
Version: 0.90
Creation Time: Tue Sep 11 21:33:24 2012
RAID Level: raid1
Array Size: 4194240 (4.00 GiB 4.29 GB)
Used Dev Size: 4194240 (4.00 GiB 4.29 GB)
Raid Devices: 2
Total Devices: 2
Preferred Minor: 1
Persistence: Superblock is persistent
Update Time: Wed 10 Jun 11:11:05 2015
State: clean
Active Devices: 2
Working Devices: 2
Failed Devices: 0
Spare Devices: 0
UUID: 2db35cef:bde058e8:1f51fb89:78ee93fe
Events: 0.251
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
Dedicated Server with 2 SSDs, 3 hard drives, and RAID 5
[root@localhost ~]# mdadm -D /dev/md127
/dev/md127:
Version : 1.0
Creation Time : Mon Feb 23 10:05:22 2026
RAID Level : raid1
Array Size : 1428416 (1394.94 MiB 1462.70 MB)
Used Dev Size : 1428416 (1394.94 MiB 1462.70 MB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Tue Feb 24 14:24:22 2026
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Consistency Policy : resync
Name : punix:2
UUID : 92475c4d:a0880ac6:3192b41e:d1db328b
Events : 43
Number Major Minor RaidDevice State
0 8 2 0 active sync /dev/sda2
2 8 50 1 active sync /dev/sdd2
If a drive is missing, the output looks similar to this:
mdadm -D /dev/md0
/dev/md0:
Version: 00.90.00
Creation Time: Thu Aug 21 12:22:43 2003
Raid Level: raid1
Array Size: 102208 (99.81 MiB 104.66 MB)
Device Size: 102208 (99.81 MiB 104.66 MB)
Raid Devices: 2
Total Devices: 1
Preferred Minor: 0
Persistence: Superblock is persistent
Update Time: Fri 15 Oct 06:25:45 2004
State: dirty, no-errors
Active Devices: 1
Working Devices: 1
Failed Devices: 1
Spare Devices: 0
Number Major Minor RaidDevice State
0 0 0 0 faulty removed
1 3 1 1 active sync /dev/sda1
UUID : f9401842:995dc86c:b4102b57:f2996278
Set up continuous monitoring
If you have configured your server's operating system to send emails, you can receive an error notification via email if a drive fails.
Preparing email delivery
Ensure that your server can send emails.
Note
You can use Postfix, for example, to send and receive emails. You can find instructions on how to configure Postfix to use an IONOS email account in the article: Setting up Postfix (Linux)
Configure the notification address
To ensure you are automatically notified in the event of a failure, the mdadm service should run as a background daemon.
Open the configuration file with an editor (e.g., nano or vi). The path depends on your distribution:
Ubuntu 22.04, Ubuntu 24.04, and Debian 13:/etc/mdadm/mdadm.conf
AlmaLinux and Rocky Linux 9/10:
/etc/mdadm.conf
Example:
[root@localhost ~]# vi /etc/mdadm/mdadm.conf
Note
The vi editor has an insert mode and a command mode. You can enter insert mode by pressing the [i] key. In this mode, the characters you type are inserted into the text immediately. To switch to command mode, press [ESC] afterwards. When you are in command mode, your keystrokes are interpreted as commands.
Locate or add the MAILADDR line and enter your email address:
MAILADDR admin@example.com
- To exit vi and save the file, type the command :wq and then press Enter.
Start the monitoring service
To start the monitoring service and ensure it loads automatically at every system boot, enter the following command:
AlmaLinux and Rocky Linux 9 and 10
[root@localhost ~]# systemctl enable --now mdmonitor
Ubuntu 22.04, Ubuntu 24.04, and Debian 13
[root@localhost ~]# systemctl enable --now mdadm
[root@localhost ~]# update-initramfs -u
Check logs
In addition to sending emails, all RAID events are recorded in the system log. You can view this information using the following commands:
AlmaLinux and Rocky Linux 9 and 10
[root@localhost ~]# journalctl -u mdmonitor -f
Ubuntu 22.04, Ubuntu 24.04, and Debian 13
[root@localhost ~]# journalctl -u mdadm -f
Depending on the distribution, you can find the log records in these system log files:
Debian 13: /var/log/syslog
AlmaLinux/Rocky Linux: /var/log/messages
Universal (Journald): journalctl -u mdmonitor -f