16.10. RAID services
You can automate RAID consistency checks using systemd and mdadm. Schedule regular scans, detect and repair bad blocks, and log inconsistencies to maintain storage reliability on Linux systems.
The following components work together to perform automated RAID consistency checks on systems by using mdadm with systemd:
config.file-
The
/etc/sysconfig/raid-checkfile contains the configuration instructions for the RAID check behavior. raid-check.timer-
This is a systemd timer that determines when the
raid-checkservice runs. You can configure its schedule as needed. raid-check.service-
This is a systemd
raid-checkservice that runs when triggered by theraid-check timer. It executes the/usr/sbin/raid-checkscript. raid-check script-
The
raid-check.serviceexecutes theraid-checkscript. It checks for data mismatch counts and attempts to repair any bad blocks found. If a mismatch is detected, it logs a warning, except for RAID1 and RAID10, where mismatch counts do not work. However, it still performs check operations on RAID and RAID10 to identify and fix bad blocks.