0
  Login

HowTo: Speed Up Linux Software Raid Building And Re-syncing

Sometimes when assembling a raid array, you may find that it is going to take hours, even worse, days to complete.  Luckily there are ways to increase the assemble time with some useful commands which should decrease the time considerably.

To increase the rebuild speed, enter:

echo value > /proc/sys/dev/raid/speed_limit_min

OR

sysctl -w dev.raid.speed_limit_min=value

In this example, set it to 60000 K/Sec, enter:

echo 60000 > /proc/sys/dev/raid/speed_limit_min

OR

sysctl -w dev.raid.speed_limit_min=60000

If you want to override the default settings you could add these two lines to /etc/sysctl.conf:

dev.raid.speed_limit_min = 60000
dev.raid.speed_limit_max = 200000

Bitmap Option

Bitmaps optimize rebuild time after a crash, or after removing and re-adding a device.

Turn it on by typing the following command:

mdadm –grow –bitmap=internal /dev/md0

Once array rebuild or fully synced, disable bitmaps:

mdadm –grow –bitmap=none /dev/md0

The net result

The rebuild rate jumps from 4k to 61k:

cat /proc/mdstat

Sample outputs:

Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath]
md5 : active raid1 sde2[2](S) sdd2[3](S) sdc2[4](S) sdb2[1] sda2[0]
      530048 blocks [2/2] [UU]
md0 : active raid6 sde3[4] sdd3[3] sdc3[2] sdb3[1] sda3[0]
      5855836800 blocks level 6, 64k chunk, algorithm 2 [5/5] [UUUUU]
      [============>........]  resync = 61.7% (1205475036/1951945600) finish=242.9min speed=61204K/sec
About the Author