Re: resizing of raid5?

Neil Brown (neilb@cse.unsw.edu.au)
Thu, 2 Aug 2001 15:52:10 +1000 (EST)


On Wednesday August 1, hyperion@gnyrf.net wrote:
> Quoting Neil Brown <neilb@cse.unsw.edu.au>:
>
> >
> > The only way to resize a raid5 array is to back up, rebuild, and
> > re-load. Any attempt to re-organise the data, or the linkage, to
> > avoid this would be more trouble that it is worth.
> >
> > NeilBrown
>
> Well, the problem is that it's not that easy when you want to backup say 200GB
> of data to find anyone that can hold it for the day while you do it. Well, at
> least do it without charge :)
> Having things offline for up to a few days while you do the rebuild is okay for
> my case, but the offloading the data is not. If I have understood md and raid5,
> you create blocks of a fixed size, and calculate the checksum on each "stripe".
> To rebuild this looks a bit like disk defragmentation to me, or am I totally
> wrong here?

Hmm. Your backup strategy is ????

Yes, you could it. It would probably be slower that writting to tape
and restoring, but if you don't have a tape......

You would find it very difficult to maintain safety in the event of
failure during the re-org process, but if you are willing to risk that
you could certainly write a fairly stright forward program to do it.

Suppose you are reconfiguring from a N drive array to an M drive
array, and both the old and the new array use a chunk size of C.

Then choose a number X such that the staging area that you have
(either RAM or some other drive) can contain (N-1)*(M-1)*C*X.

e.g. 64K chunks, 7 to 8 drives, 10 Gig disc space:

X = floor (10240/6/7/64) = 3

If you don't have enough space to stage N*M*C you can still do it but
it will be much more fiddly.

Then read X*N*M*C of the drive using the N drive layout into the
staging area. Then write it back out using the M drive layout.
Repeat until done.
You don't need to worry about calculating parity when writing out as
you can get the raid5 module to do that automatically when you tell it
about the new array.

If you (or anyone else) would like to try writting code to do this, I
would be happy to review, comment, and test. You could probably even
do it reasonably well in perl...

NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/