Linux Software RAID Tips

Linux Software RAID Tips

After a sever build including a software raid setup let the RAID resync all the partions before continuing to configure or transfer large amounts of data to the server.

You can check the RAID status at any time with cat /proc/mdstat (centos).

Linux RAID resync speed is by default very slow at 1000KB/s, at this speed a modern 3Tb disk set takes approximately 10 days to finish. The rebuilt speed is defined in the config files :

/proc/sys/dev/raid/speed_limit_min
/proc/sys/dev/raid/speed_limit_max

As the names suggest speed_limit_min is a minimum goal speed by default 1000KB/s and speed_limit_max is a maximum goal speed my system has a default of 200000KB/s. To change the values in these files simply change the value in the files.

echo 50000 > /proc/sys/dev/raid/speed_limit_min
echo 100000 > /proc/sys/dev/raid/speed_limit_max

My system seemed to be able sustain a resync speed of around 100000KB/s so sensible values maybe  a speed_limit_min of 50000 and a speed_limit_max or 90000. If the minimum or maximum speed is set too high data transfer speed for other operations will be affected.

Once a week on Sunday at 1am my CentOS system is scheduled to resync the drives. Sometimes this is not a convenient time. To change the time edit the file /etc/crond.d/raid-check. To turn off the check completely.