MDADM - Slowing Down Rebuild

You can pause a rebuild with this:

echo "idle" > /sys/block/md0/md/sync_action

Assuming md0 is your md device. However, mdadm will commence rebuilding on an “event” which it isn’t clear what that would be. I suspect a read or write to the array will kick off the rebuild again - so often this command does nothing obvious as the rebuild stops and then immediately restarts. If you have multiple md devices, then this will cause mdadm to rebuild the next one that needs it.

To throttle the rebuild, you can use:

echo 5000 > /proc/sys/dev/raid/speed_limit_max

This will limit the rebuild maximum throughput to 5Mb/s.

You can see the current resync speed by doing:

cat /proc/mdstat