7

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?

  • Yes, shutting it down during the operation would be a "loss of power" and it would be pretty catastrophic. – Michael Hampton Apr 29 '13 at 15:42
  • 3
    seems that graceful shutdown does not necesarily cause trouble with reshaping arrays - in http://www.spinics.net/lists/raid/msg40771.html Neil Brown states: "If the machine was shutdown by a crash during reshape you might suffer corruption. If it was a clean shutdown you won't." – mateusz.kijowski Apr 30 '13 at 00:50
  • 3
    I hope you have backups. :) – Michael Hampton Apr 30 '13 at 01:53

2 Answers2

1

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.

LapTop006
  • 6,496
  • 20
  • 26
0

You should stop array before shutdown:

mdadm -S /dev/md1

You may also play with variables in /sys/block/md1/md, most interesting are array_state and sync_action. Here is documentation: https://www.kernel.org/doc/Documentation/md.txt But remember, you have only one attempt.

If there is no backup of this data - you should not power off the machine.

Please write here, what did you do and did data on raid survive.

Selivanov Pavel
  • 2,206
  • 3
  • 26
  • 48