Re: Upgrading mdadm-based RAID arrays



On Thu, May 14, 2009 at 02:06:59PM -0700, Tyler MacDonald wrote:
Got an answer: RTFM! :-)

-z, --size=
[...]
This value can be set with --grow for RAID level 1/4/5/6. If the
array was created with a size smaller than the currently active
drives, the extra space can be accessed using --grow. The size
can be given as max which means to choose the largest size that
fits on all current drives.




Tyler MacDonald <tyler@xxxxxx> wrote:
Hello debian!

I have a RAID-5 mdadm array with 4x500GB drives (1.4TB usable). I'm
running out of space and am going to buy a new drive, but I would like to
move to 1TB drives (either RAID-5 or RAID-10, haven't quite decided yet). I
can't afford to buy all new 1TB drives at once so I'm thinking about just
adding a fifth drive to the array now, and then upgrading the remaining
drives as I can afford it.

I've dug around trying to find information on how to do this and haven't
seen anything yet. I've imagined the process to be something like: ("Plan
A")

1. One-by-one, replace the 500GB drives with 1TB drives, rebuilding the
array using only the first 500GB of each drive.

2. Once all drives are 1TB, do something to tell mdadm to reshape the
array so that the full 1TB from each drive is used

3. e2fsck -f /dev/md0 && resize2fs /dev/md0

Does step #2 exist? If so, how is it done?

If that's not possible, I'm considering the following plan: ("Plan B")

1. Buy 2x1TB drives, set them up as RAID-5 (1TB usable)

2. Copy 1TB of the 1.4TB to the new array

3. Degrade my existing 4x500GB array, freeing up 1x500GB drive

4. Copy the remaining 400GB to the "spare" drive

5. Tear down the 3x500GB array

6. Set up 2x500GB from the old array as a 1TB RAID-0 stripe

7. Add the 2x500GB RAID-0 to the new RAID-5 as a "1TB drive",
making the new array have 2TB capacity, eg;
mdadm --add /dev/md0 /dev/md1
mdadm --grow /dev/md0 ...

8. Copy the data from the "spare" drive over to the new array

9. Repeat step #7 with the remaining 2x500GB drives, resulting in
3TB capacity on the array

I'd really prefer to go with "Plan A". It's cheaper to get started with,
far less complicated, and doesn't risk data loss during the move.

Any ideas? Is this possible?

I wouldn't make up raid devices with other raid device (I think its
possible), but I seem to remember thats its not advisable.

the first option would be my preference ( I have done it previously), I
have taken a 3 drive 500Gb and replaced it slowly with 1TB drives, take
out drive, let it rebuild and then replace another drive let it rebuild,
till I have 3x1T but still using the same space as before, then use the
grow as you suggested above, you can also grow to go from 3 drives to 4
drives.

I would suggest though, when you get to around 5 or 6 drives you look at
raid6 instead.




Thanks,
Tyler




--
"Keep good relations with the Greecians."

- George W. Bush
04/09/1999
as quoted in The Economist

Attachment: signature.asc
Description: Digital signature