14

This may sound silly, but is there a way to intentionally reduce the speed of a rebuild in a Linux Software RAID? (Basically reducing the throughput of all of the disks so that it's not maxing out.)

The RAID itself is just a bunch of drives connected via external SATA to a Slackware 13.37 box running software RAID (everything controlled by mdadm). The drives aren't of the highest quality (it's a budget home system) and I'd just like the peace of mind that I'm not pushing them too much.

Maybe there's a way to pause and unpause the rebuild, which I can script to happen from time to time?

David
  • 858

1 Answers1

31

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
Paul
  • 61,193