Emergency Linux raid (mdadm) question

The Hunter

Limp Gawd
Joined
May 29, 2002
Messages
414
Okay, so I'm a bonehead and just did something very stupid.
I have a 3x500GB raid array and I put in another 500GB disk and went to grow the array.
First I added the new disk the the array
Code:
mdadm --add /dev/md0 /dev/sde
no problem.
Next, I went to grow the array, but foolishly I entered 5 instead of 4 for the number of devices:
Code:
mdadm --grow /dev/md0 -n [B]5[/B]

I wouldn't expect it to work, but it went ahead and started to reshape the array from 3 disks to a 5 disk degraded array, even with only 4 disks present. I didn't realize what I had done until about 5 minutes later.

The good news is that presumably all my data will be intact, but I'm uncomfortable running the array in a degraded status.

So my question, is there anyway to safely cancel a raid5 expand? From my preliminary googling, it doesn't seem possible (and I know it's not possible to shrink an array). Is there any way of salvaging this aside from letting the expand continue, moving my data off the array and rebuilding from scratch?
 
Well I wouldn't try this BUT if you just hit the reset button on your computer... lol next time it starts back up it will automatically undo the unfinished grow. I tried this out awhile ago to see what would happen and it worked.

There is no undo however... you're really SOL.... then again 500GB drives are cheap.. get another :).
 
Actually I tried to find the documentation and I guess even if the grow gets interrupted the next boot it'll just restart it. I think when I did it I must have been using EVMS prior to mdadm being able to grow. So pretty much certainly you're stuck with the grow... but at least you have an excuse to buy another disk!
 
Yeah, getting a new drive is starting to look like the simplest possibility, since I don't have enough capacity on my other computers to save everything (it's a media server, so I decided to be "clever" and save money by not going for a backup solution), but the snag is I'm out of SATA ports. I can order a reasonably priced SATA adapter, and 500gig seagates are going for $80 a pop now, but that's still a pricey typo. Mostly I'm concerned about the time it'll take to get the parts shipped out. I suppose this will teach me to double check the parameters next time...
 
Back
Top