Linux – Is it safe to interrupt a mdadm –grow operation

linuxmdadm

I recently changed the disks in my RAID5 from 3x2TB to 3x3TB. I also wanted to change the chunk size from default 512k to 128k. I have added all new devices to the array and I run:

mdadm /dev/md1 --grow --backup-file=/boot/md1_grow_backup_file --chunk=128

The –backup-file option is necessary because of the chunk size change and the file specified by it is on a different block device.

I have to shutdown the server to physically move it, but the reshape operation is going much slower than I anticipated, so I'm wondering if I can interrupt the process and continue it after reboot.

The manpage has some information on interrupting the –grow/reshape process, but it seems to me that this was meant to cover some catastrophic circumstances – loss of power, server lockup, etc.

Is it possible to gracefully stop a mdadm array reshape? If so, how to stop the array and how to resume the reshape after booting? Will the backup file be necessary?

Best Answer

On the first part you may be a victim of MD's default slow rebuild speed.

A good article covering the options is at:

http://www.cyberciti.biz/tips/linux-raid-increase-resync-rebuild-speed.html

But in short:

sysctl -w dev.raid.speed_limit_min=1000
sysctl -w dev.raid.speed_limit_max=100000

To guarantee between 1 and 100MB available for rebuilds, if the server is active upping the min is a good way to speed things up, but at the cost of some responsiveness.

Related Topic