Re: Reshaping raid0/10

2007-03-11 Thread Neil Brown
On Saturday March 10, [EMAIL PROTECTED] wrote:
 Neil Brown wrote:
  
  If I wanted to reshape a raid0, I would just morph it into a raid4
  with a missing parity drive, then use the raid5 code to restripe it.
  Then morph it back to regular raid0.
  
 
 Wow, that made my brain hurt.
 
 Given the fact that we're going to have to do this on kernel.org soon, 
 what would be the concrete steps involved (we're going to have to change 
 3-member raid0 into 4-member raid0)...

Well it's not straight forward at all.

Firstly: it can only work if all your drives are the same size
(rounded to 64K).  If they aren't raid0 will use all the available
space on each drive, while raid5 will only use the amount that is
available on the first drive.

If that condition is met, then you can safely convert to a raid4 with
one extra (missing) device by simply creating an array with the same
drives (so you have to stop and restart the array - you cannot do that
bit while the array is live).  You seem to need --assume-clean
to create the raid4 degraded... That is probably a bug in mdadm.

md/raid5 won't grow a degraded array, so now you have to add the new
drive and let it sync the parity information onto it even though you
aren't going to ultimately use it.  This is a bit of a bore.  It could
probably be fixed but it wouldn't be entirely trivial (meaning a day
rather than an hour).

Once you have the non-degraded raid4, the next step would be
  mdadm -G /dev/mdX -n 5 --backup-file=/root/something
(a 5 drive raid4 contains your 4drive raid0).  Growing to a degraded
array is not a problem.  However md won't currently let you do this
on a raid4.   The patch to fix this is trivial and is below.

The --backup-file is needed as there is no spare for mdadm to store
some temporary data on.

Once the grow finishes, you can unmount, stop the array, and create it
as a raid0.

This seems to work - I just tried it on a rather small filesystem
(100M per drive) and it all went quite smoothly.

I hope to be able to get all this automated one days so you can just
  mdadm -G /dev/mdX -n 4
on a raid0 and it will work.

The need to sync the new disk first adds some real awkwardnesses.  It
would actually be a lot easier if the parity device was the first of
the array instead of the last.. retro fitting a new raid4 layout which
you cannot accidentally corrupt be using an old kernel might be
awkward though... not impossible.

Changing a raid0 to a raid4 while on-line is also non-trivial.  Raid0
doesn't keep track of requests-in-flight so knowing when all raid0
requests have completed and it is ok to start handling requests via
raid4 will need some care..

But with the following patch and a small down-time window at each end,
you can use md to grow a raid0 today...  But I suggest you try it on
test data first.

NeilBrown


Signed-off-by: Neil Brown [EMAIL PROTECTED]

### Diffstat output
 ./drivers/md/raid5.c |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff .prev/drivers/md/raid5.c ./drivers/md/raid5.c
--- .prev/drivers/md/raid5.c2007-03-02 15:48:35.0 +1100
+++ ./drivers/md/raid5.c2007-03-12 09:02:41.0 +1100
@@ -4104,6 +4104,10 @@ static struct mdk_personality raid4_pers
.spare_active   = raid5_spare_active,
.sync_request   = sync_request,
.resize = raid5_resize,
+#ifdef CONFIG_MD_RAID5_RESHAPE
+   .check_reshape  = raid5_check_reshape,
+   .start_reshape  = raid5_start_reshape,
+#endif
.quiesce= raid5_quiesce,
 };
 
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Reshaping raid0/10

2007-03-10 Thread H. Peter Anvin

Neil Brown wrote:


If I wanted to reshape a raid0, I would just morph it into a raid4
with a missing parity drive, then use the raid5 code to restripe it.
Then morph it back to regular raid0.



Wow, that made my brain hurt.

Given the fact that we're going to have to do this on kernel.org soon, 
what would be the concrete steps involved (we're going to have to change 
3-member raid0 into 4-member raid0)...


-hpa
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Reshaping raid0/10

2007-03-10 Thread Jan Engelhardt

On Mar 10 2007 12:21, H. Peter Anvin wrote:
 Neil Brown wrote:
 
 If I wanted to reshape a raid0, I would just morph it into a raid4
 with a missing parity drive, then use the raid5 code to restripe it.
 Then morph it back to regular raid0.

 Wow, that made my brain hurt.

 Given the fact that we're going to have to do this on kernel.org soon, what
 would be the concrete steps involved (we're going to have to change 3-member
 raid0 into 4-member raid0)...

Iff it was in the kernel, mdadm -G would suffice.


Jan
-- 
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Reshaping raid0/10

2007-02-23 Thread Jan Engelhardt

On Feb 22 2007 06:59, Neil Brown wrote:
On Wednesday February 21, [EMAIL PROTECTED] wrote:
 
 are there any plans to support reshaping
 on raid0 and raid10?
 

No concrete plans.  It largely depends on time and motivation.
I expect that the various flavours of raid5/raid6 reshape will come
first.
Then probably converting raid0-raid5.

I really haven't given any thought to how you might reshape a
raid10...

It should not be any different from raid0/raid5 reshaping, should it?



Jan
-- 
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Reshaping raid0/10

2007-02-23 Thread Neil Brown
On Friday February 23, [EMAIL PROTECTED] wrote:
 
 On Feb 22 2007 06:59, Neil Brown wrote:
 On Wednesday February 21, [EMAIL PROTECTED] wrote:
  
  are there any plans to support reshaping
  on raid0 and raid10?
  
 
 No concrete plans.  It largely depends on time and motivation.
 I expect that the various flavours of raid5/raid6 reshape will come
 first.
 Then probably converting raid0-raid5.
 
 I really haven't given any thought to how you might reshape a
 raid10...
 
 It should not be any different from raid0/raid5 reshaping, should it?

Depends on what level you look at.

If I wanted to reshape a raid0, I would just morph it into a raid4
with a missing parity drive, then use the raid5 code to restripe it.
Then morph it back to regular raid0.

With raid10 I cannot do that.  I would need to do the restriping
inside the raid10 module.  But raid10 doesn't have a stripe-cache like
raid5 does, and the stripe cache is a very integral part of the
restripe process.

So there would be a substantial amount of design and coding to effect
a raid10 reshape - at least as much as the work to produce the initial
raid5 reshape and probably more.

So conceptually it might be very similar, but at the code level, it is
likely to be very different.

NeilBrown
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Reshaping raid0/10

2007-02-21 Thread Jan Engelhardt
Hello,



are there any plans to support reshaping
on raid0 and raid10?



Jan
-- 
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Reshaping raid0/10

2007-02-21 Thread Neil Brown
On Wednesday February 21, [EMAIL PROTECTED] wrote:
 Hello,
 
 
 
 are there any plans to support reshaping
 on raid0 and raid10?
 

No concrete plans.  It largely depends on time and motivation.
I expect that the various flavours of raid5/raid6 reshape will come
first.
Then probably converting raid0-raid5.

I really haven't given any thought to how you might reshape a
raid10...

NeilBrown
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Reshaping raid0/10

2007-02-21 Thread dean gaudet
On Thu, 22 Feb 2007, Neil Brown wrote:

 On Wednesday February 21, [EMAIL PROTECTED] wrote:
  Hello,
  
  
  
  are there any plans to support reshaping
  on raid0 and raid10?
  
 
 No concrete plans.  It largely depends on time and motivation.
 I expect that the various flavours of raid5/raid6 reshape will come
 first.
 Then probably converting raid0-raid5.
 
 I really haven't given any thought to how you might reshape a
 raid10...

i've got a 4x250 near2 i want to turn into a 4x750 near2.  i was 
considering doing straight dd from each of the 250 to the respective 750 
then doing an mdadm --create on the 750s (in the same ordering as the 
original array)... so i'd end up with a new array with more stripes.  it 
seems like this should work.

the same thing should work for all nearN with a multiple of N disks... and 
offsetN should work as well right?  but farN sounds like a nightmare.

if we had a generic proactive disk replacement method it could handle 
the 4x250-4x750 step.  (i haven't decided yet if i want to try my hacky 
bitmap method of doing proactive replacement... i'm not sure what'll 
happen if i add a 750GB disk back into an array with 250s... i suppose 
it'll work... i'll have to experiment.)

-dean
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html