As an alternative option, temporary changing some parameters can drastically speed up the raid expansion in some cases (for example, from 10 days to 16 hours).
You can use cat /proc/mdstat
and mdadm --detail /dev/mdX
to find the raid device you are expanding. Often it is md2
, while other are ~2GB mirrored system partitions.
Write down current values first to restore them later.
$ cat /sys/block/md2/md/stripe_cache_size
$ cat /proc/sys/dev/raid/speed_limit_min
$ cat /sys/block/md2/queue/read_ahead_kb
$ cat /sys/block/md2/md/sync_max
$ echo 32768 > /sys/block/md2/md/stripe_cache_size
$ echo 50000 > /proc/sys/dev/raid/speed_limit_min
$ echo 32768 > /sys/block/md2/queue/read_ahead_kb
$ echo max > /sys/block/md2/md/sync_max
stripe_cache_size
is the max value, and it takes up 32Mib to synchronize read/write operations while the array is degraded.
speed_limit_min
is a hint that you want more focus on the sync-expansion task. It also exists as a GUI option in DSM 6 and 7.
read_ahead_kb
is how far ahead of a read request the drive array will preload.
sync_max
is the numbers of sectors that indicate a range within the array where check/repair will operate (there is also a sync_min). This one seems to give the most impact for some.
Sources: