2

I just converted my RAID1 array to a RAID5 array and added a third disk to it. I'd like to add a fourth disk without waiting fourteen hours for the first reshape to complete.

I just did this:

mdadm /dev/md0 --add /dev/sdf1
mdadm --grow /dev/md0 --raid-devices=3 --backup-file=/root/md0_n3.bak

The entry in /proc/mdstat looks like this:

md0 : active raid5 sdf1[2] sda1[0] sdb1[1]
      976759936 blocks super 0.91 level 5, 64k chunk, algorithm 2 [3/3] [UUU]
      [>....................]  reshape =  1.8% (18162944/976759936) finish=834.3min speed=19132K/sec

Now I'd like to do this:

mdadm /dev/md0 --add /dev/sdd1
mdadm --grow /dev/md0 --raid-devices=4 --backup-file=/root/md8_n4.bak

Is this safe, or do I have to wait for the first reshape operation to complete?

P.S.: I know I should have added both disks first, and then reshaped from 2 to 4 devices, but it's a little late for that.

smammy
  • 427
  • 3
  • 7

1 Answers1

4

Well the answer to that would be you have to wait it out.

Lucas Kauffman
  • 16,818
  • 9
  • 57
  • 92
  • Well, that's what I was afraid of. On the bright side, it ended up only taking 9 hours to finish. – smammy Nov 18 '12 at 16:00
  • Restructuring a restructure in progress is a great way to lobotomize your data. The data is in a state of flux - some blocks are relocated, others are not - and while your precious data is being twisted into new and unnatural shapes by mdadm, do you really want to twist it yet again? What happens if the rebuild failed in the middle? With just the one restructure, it knows where to re-start and can recover; there is a single demarcation point to start from. With both, how does it know what to do? – Avery Payne Jan 26 '14 at 03:11