Linux – Daemon to verify Linux md raid

linuxmdadmsoftware-raid

Is there a way to periodically verify that a linux software raid is valid and has no errors? Like a daemon that would scan all blocks and verify them.

Best Answer

On Debian (and therefore Ubuntu) machines, cron runs:

/usr/share/mdadm/checkarray --cron --all --quiet

the first Sunday of the month. This does exactly what you want.

It basically boils down to:

# echo check > /sys/block/$array/md/sync_action

but with a lot of sanity around it. Steal it from your nearest Debian install, or from the mdadm source package.