This episode covers routine storage maintenance: checking array integrity with mdadm --check and --repair, ZFS and btrfs scrub, scheduling them automatically, and physical care such as UPS, disk aging, and firmware updates.

Building an array is a one-time event; maintaining it is ongoing. Episode 15 covers the routine care that keeps storage healthy for years: scrubbing to check data integrity and physical maintenance to protect the storage environment.
A scrub is a thorough sweep that looks for damaged blocks before they're needed — analogous to a medical check-up done while healthy, not while sick. Combined with care like UPS and firmware updates, you can extend an array's lifespan and avoid needless failures.
mdadm provides two scrub modes: --check which only verifies consistency, and --repair which fixes discrepancies found:
echo check > /sys/block/md0/md/sync_action
cat /proc/mdstatThe echo check > /sys/block/md0/md/sync_action command starts the check. The /proc/mdstat output shows check = 42.3% with progress. When the check finds discrepancies, it records them in the mdadm and kernel logs.
If --check finds problems and you have the redundancy to fix them:
echo repair > /sys/block/md0/md/sync_actionThe echo repair command fixes discrepancies using consistent data from other disks. Remember: a scrub uses full I/O resources while running — for large disks, make sure it's scheduled outside peak hours.
ZFS offers the most powerful scrub: it checks the checksums of all blocks and repairs damaged ones automatically:
sudo zpool scrub tank
zpool status tankThe zpool status tank output shows a scan: scrub in progress since ... line with X.X% done. When finished, the status becomes scrub repaired 0B in ... with 0 errors on .... A non-zero error count means corruption was found — investigate further.
zpool status tank
sudo zpool scrub -s tankThe zpool scrub -s tank command stops a running scrub. This is useful if the scrub is interfering with production workloads — move the schedule to a quieter time.
For the btrfs filesystem, scrub runs per mounted filesystem:
sudo btrfs scrub start /mnt/data
sudo btrfs scrub status /mnt/dataThe btrfs scrub start /mnt/data command checks all blocks and repairs errors using redundancy. The btrfs scrub status output shows the status and error counts.
Unscheduleed scrubs often get forgotten. Schedule them with cron, for example every Sunday morning:
0 3 * * 0 /usr/sbin/zpool scrub tank
0 4 * * 0 echo check > /sys/block/md0/md/sync_actionThe cron lines above run ZFS and mdadm scrubs every Sunday. For mdadm, it's better to use mdadm --check via a systemd timer or a script that waits until completion.
A practical rule: scrub once a month for ZFS and mdadm on normal data, or once a week for arrays with critical data. Scrubbing too often wastes I/O; too rarely lets corruption pile up undetected.
Warning
Scrub and rebuild must not run simultaneously. Both consume the full I/O bandwidth of the disks and slow each other down. If a scrub is running when a disk fails, stop the scrub first, handle the rebuild, then run the scrub again once the array is stable.
Unstable power is the most common storage killer. Install a UPS adequate for the server, make sure the system shuts down automatically when the battery runs low, and check the UPS battery status periodically:
apcaccess statusThe apcaccess status output shows LINEV, LOADPCT, BCHARGE, and STATUS. A worn-out UPS battery provides deceptive protection — replace the battery before it actually dies.
Disks have a lifecycle. Pay attention to:
Updating disk firmware is a risky operation that can sometimes even change how a disk behaves. The safe rules: read the vendor changelog, do it on a single spare disk first, and never update the firmware of all array disks at once — you don't want every disk offline at the same time.
Episode 15 equipped you with maintenance habits: scrubbing with mdadm --check and --repair, zpool scrub, and btrfs scrub, scheduled routinely, plus physical care like UPS, temperature control, and careful firmware updates.
Key takeaways:
mdadm --check verifies, --repair fixes discrepancies on the array.zpool scrub checks the checksums of all ZFS blocks and repairs automatically.btrfs scrub to check and repair the filesystem.In the next episode, episode 16, we'll discuss troubleshooting & recovery scenarios — facing a degraded array, a failed rebuild, corrupted metadata, even OOM and kernel panic, complete with --force assemble and ddrescue for damaged disks. You'll learn to stay calm when storage misbehaves.