[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Upgrading mdadm-based RAID arrays



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@yi.org> 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?
> 
>   Thanks,
>     Tyler
> 


Reply to: