This episode teaches you how to read an array's condition via /proc/mdstat and mdadm --detail, interpret states such as clean, active, degraded, and rebuilding, and set up mdadm --monitor and systemd mdmonitor for failure notifications.

In episode 4 you learned how to create an array. Now the question is: how do you know the array is healthy? Episode 5 teaches reading and monitoring the array — two skills that distinguish a reactive admin from a proactive one.
The bad news is that disks fail without announcement. The good news is that the Linux kernel provides a complete information window through /proc/mdstat and the mdadm --detail command. By understanding both, you can detect problems before users report them. Let's start with the first window.
The /proc/mdstat file is the fastest source of array status in Linux. Read it with:
cat /proc/mdstatA typical output shows:
Personalities : [raid1] [raid6] [raid5] [raid4]
md0 : active raid1 sdb[0] sdc[1]
4193280 blocks super 1.2 [2/2] [UU]
[==========>...........] resync = 55.3% (2323488/4193280) finish=2.1min speed=15000K/sec
unused devices: <none>The [2/2] [UU] figure is the core thing you must understand: the numerator states the number of active devices, the denominator the number there should be. U means the device is up, _ means the device has failed. If you see [1/2] [_U], one disk is already dead.
Besides clean or active, /proc/mdstat shows ongoing operations:
The speed and finish lines give an estimate of when the operation will complete. If a rebuild runs too long, you can adjust its speed — we'll cover how in episode 16.
For complete information on one array, use:
sudo mdadm --detail /dev/md0The output shows State : clean, Active Devices : 2, Working Devices : 2, Failed Devices : 0, and Spare Devices : 0. There's also Rebuild Status : 55% complete during an ongoing process.
Here's the list of states you'll encounter:
Warning
A degraded state is no reason to panic, but it's also no reason to delay. A degraded array has lost its redundancy protection — one more failure means data loss. Replace the failed disk as soon as possible; we'll practice this in episode 6.
You can see a summary of all arrays with a single command:
sudo mdadm --detail --scanThe output of mdadm --detail --scan prints a line like ARRAY /dev/md0 metadata=1.2 name=... UUID=... for each array. This is the form copied into mdadm.conf in episode 4.
mdadm --monitor is a daemon process that watches for array status changes and takes action according to configuration. The simplest example:
sudo mdadm --monitor --scan --test --mail=admin@example.comThe --test option sends a test email to make sure the configuration works before real use. Without --test, the daemon keeps running in the foreground — for production, let systemd run it as a service.
mdadm monitor notifies you of events such as:
Each event can be sent by email or run as an external program using the --program option.
On almost all modern distros, the mdadm package provides the mdmonitor.service systemd unit that runs the monitor automatically:
sudo systemctl enable mdmonitor.service
sudo systemctl start mdmonitor.service
sudo systemctl status mdmonitor.serviceWith the service active, you don't need to run mdadm --monitor manually at every boot. Email and program configuration is set in /etc/mdadm.conf via the MAILADDR and PROGRAM lines.
Test the entire chain — from failure detection to the email arriving:
sudo mdadm --monitor --scan --test --mail=admin@example.com --syslogThe mdadm --monitor --scan --test command above sends a test email and writes to syslog. If the test email arrives, it means the daemon, MAILADDR, and the local mail service (for example mailutils) are wired up correctly.
Info
Local email requires an MTA such as postfix or msmtp. In a homelab, many admins choose to forward alerts to chat or external monitoring — we'll round out this approach in episode 13 with Prometheus and node_exporter.
Make it a habit to read the array's condition periodically:
cat /proc/mdstat to make sure no array is degraded.sudo mdadm --detail /dev/mdX to check failed and spare devices.mdmonitor.service for real-time failure notifications.With this combination, you'll know about problems within minutes, not days.
Episode 5 equipped you with observation skills: reading /proc/mdstat, interpreting mdadm --detail and array states, running mdadm --monitor for alerts, and making use of systemd's mdmonitor.service. You can now keep your array healthy proactively.
Key takeaways:
/proc/mdstat is the fastest array status window; read [U] and [_].mdadm --detail gives details on state, device count, and rebuild progress.degraded state means lost redundancy — replace the disk as soon as possible.mdadm --monitor sends email alerts on failure events.mdmonitor.service so monitoring runs automatically at boot.--test before you actually need it.In the next episode, episode 6, we'll discuss spare, replace & hot-swap — adding a hot spare with --add-spare, replacing failed disks, and making sure the rebuild runs to completion. You'll practice handling disk failures without panic.