linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* converting RAID5 to RAID10
@ 2006-10-05  9:59 martin f krafft
  2006-10-05 10:14 ` Neil Brown
  2006-10-05 10:15 ` Jurriaan Kalkman
  0 siblings, 2 replies; 6+ messages in thread
From: martin f krafft @ 2006-10-05  9:59 UTC (permalink / raw)
  To: linux-raid mailing list

[-- Attachment #1: Type: text/plain, Size: 1420 bytes --]

I have a 1.5Tb RAID5 machine (3*750Gb disks + 1 spare) and need to
move some write-intensive services there. Unfortunately, the
performance is unacceptable. Thus, I wanted to convert the machine
to RAID10.

My theory was: backup, remove the spare, set one disk faulty, remove
it, create a degraded RAID10 on the two freed disks, copy data, kill
RAID5, add disks to new RAID10.

Unfortunately, mdadm (2.5.3) doesn't seem to agree; it complains
that it cannot assemble a RAID10 with 4 devices when I ask it to:

  mdadm --create -l 10 -n4 -pn2 /dev/md1 /dev/sd[cd] missing missing

I can kind of understand, but on the other hand I don't. After all,
if you'll allow me to think in terms of 1+0 instead of 10 for
a second, why doesn't mdadm just assemble /dev/sd[cd] as RAID0 and
make the couple one of the two components of the RAID1? What I mean
is: I could set up RAID1+0 that way; why doesn't it work for RAID10?

Do you know of a way in which I could migrate the data to RAID10?
Unfortunately, I do not have more 750Gb disks available nor
a budget, and the 1.5Tb are 96% full.

Cheers,

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
spamtraps: madduck.bogus@madduck.net
 
"if a man treats life artistically, his brain is his heart."
                                                        -- oscar wilde

[-- Attachment #2: Digital signature (GPG/PGP) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: converting RAID5 to RAID10
  2006-10-05  9:59 converting RAID5 to RAID10 martin f krafft
@ 2006-10-05 10:14 ` Neil Brown
  2006-10-05 10:20   ` martin f krafft
  2006-10-05 10:15 ` Jurriaan Kalkman
  1 sibling, 1 reply; 6+ messages in thread
From: Neil Brown @ 2006-10-05 10:14 UTC (permalink / raw)
  To: martin f krafft; +Cc: linux-raid mailing list

On Thursday October 5, madduck@madduck.net wrote:
> 
> Unfortunately, mdadm (2.5.3) doesn't seem to agree; it complains
> that it cannot assemble a RAID10 with 4 devices when I ask it to:
> 
>   mdadm --create -l 10 -n4 -pn2 /dev/md1 /dev/sd[cd] missing missing
> 

mdadm --create -l 10 -n 4 -pn2 /dev/md1 /dev/sdc missing /dev/sdd missing

Raid10 lays out data like
  A A B B
  C C D D
not
  A B A B
  C D C D
as you seem to expect.

So you could even do

mdadm --create -l 10 -n 4 -pn2 /dev/md1 missing /dev/sd[cd] missing

for slightly less typing.

There seems to be a bug in raid10 that is reports the wrong number of
working drives.  This is probably only in 2.6.18.  Patch is below.

NeilBrown

Signed-off-by: Neil Brown <neilb@suse.de>

### Diffstat output
 ./drivers/md/raid10.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff .prev/drivers/md/raid10.c ./drivers/md/raid10.c
--- .prev/drivers/md/raid10.c	2006-09-29 11:44:36.000000000 +1000
+++ ./drivers/md/raid10.c	2006-10-05 20:10:07.000000000 +1000
@@ -2079,7 +2079,7 @@ static int run(mddev_t *mddev)
 		disk = conf->mirrors + i;
 
 		if (!disk->rdev ||
-		    !test_bit(In_sync, &rdev->flags)) {
+		    !test_bit(In_sync, &disk->rdev->flags)) {
 			disk->head_position = 0;
 			mddev->degraded++;
 		}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: converting RAID5 to RAID10
  2006-10-05  9:59 converting RAID5 to RAID10 martin f krafft
  2006-10-05 10:14 ` Neil Brown
@ 2006-10-05 10:15 ` Jurriaan Kalkman
  2006-10-05 10:25   ` Ask Bjørn Hansen
  1 sibling, 1 reply; 6+ messages in thread
From: Jurriaan Kalkman @ 2006-10-05 10:15 UTC (permalink / raw)
  To: linux-raid mailing list

> I have a 1.5Tb RAID5 machine (3*750Gb disks + 1 spare) and need to
> move some write-intensive services there. Unfortunately, the
> performance is unacceptable. Thus, I wanted to convert the machine
> to RAID10.
>
> My theory was: backup, remove the spare, set one disk faulty, remove
> it, create a degraded RAID10 on the two freed disks, copy data, kill
> RAID5, add disks to new RAID10.
>
> Unfortunately, mdadm (2.5.3) doesn't seem to agree; it complains
> that it cannot assemble a RAID10 with 4 devices when I ask it to:
>
>   mdadm --create -l 10 -n4 -pn2 /dev/md1 /dev/sd[cd] missing missing
>
> I can kind of understand, but on the other hand I don't. After all,
> if you'll allow me to think in terms of 1+0 instead of 10 for
> a second, why doesn't mdadm just assemble /dev/sd[cd] as RAID0 and
> make the couple one of the two components of the RAID1? What I mean
> is: I could set up RAID1+0 that way; why doesn't it work for RAID10?
>
> Do you know of a way in which I could migrate the data to RAID10?
> Unfortunately, I do not have more 750Gb disks available nor
> a budget, and the 1.5Tb are 96% full.
>
AFAIK, linux raid-10 is not exactly raid 1+0, it allows you to, for
example, use 3 disks. You could create a raid-0, then later add that as a
component to a raid-1. A tested backup would certainly be helpful,
although it should work without it (and I can easily say that, as it's not
my data that will be lost: YMMV!)

Jurriaan



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: converting RAID5 to RAID10
  2006-10-05 10:14 ` Neil Brown
@ 2006-10-05 10:20   ` martin f krafft
  0 siblings, 0 replies; 6+ messages in thread
From: martin f krafft @ 2006-10-05 10:20 UTC (permalink / raw)
  To: linux-raid mailing list

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

also sprach Neil Brown <neilb@suse.de> [2006.10.05.1214 +0200]:
> mdadm --create -l 10 -n 4 -pn2 /dev/md1 /dev/sdc missing /dev/sdd missing

Peter Samuelson of the Debian project already suggested this and it
seems to work.

Thanks a lot, Neil, for the quick and informative response.

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
spamtraps: madduck.bogus@madduck.net
 
"the ships hung in the sky in much the same way that bricks don't."
                                 -- hitchhiker's guide to the galaxy

[-- Attachment #2: Digital signature (GPG/PGP) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: converting RAID5 to RAID10
  2006-10-05 10:15 ` Jurriaan Kalkman
@ 2006-10-05 10:25   ` Ask Bjørn Hansen
  2006-10-05 11:34     ` Neil Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Ask Bjørn Hansen @ 2006-10-05 10:25 UTC (permalink / raw)
  To: jurriaan; +Cc: linux-raid mailing list


On Oct 5, 2006, at 3:15 AM, Jurriaan Kalkman wrote:

> AFAIK, linux raid-10 is not exactly raid 1+0, it allows you to, for
> example, use 3 disks.

I made a raid-10 device earlier today with 7 drives and I was  
surprised to see that it reported to use all of them.  I thought it'd  
make one of them a spare (or complain about the odd number of drives).

How does that work?  (Or is it the "number of drives reported" bug  
Neil referred to a moment ago?  I use FC6's version of 2.6.18).


  - ask

-- 
http://www.askbjoernhansen.com/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: converting RAID5 to RAID10
  2006-10-05 10:25   ` Ask Bjørn Hansen
@ 2006-10-05 11:34     ` Neil Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Neil Brown @ 2006-10-05 11:34 UTC (permalink / raw)
  To: Ask Bjørn Hansen; +Cc: jurriaan, linux-raid mailing list

On Thursday October 5, ask@develooper.com wrote:
> 
> On Oct 5, 2006, at 3:15 AM, Jurriaan Kalkman wrote:
> 
> > AFAIK, linux raid-10 is not exactly raid 1+0, it allows you to, for
> > example, use 3 disks.
> 
> I made a raid-10 device earlier today with 7 drives and I was  
> surprised to see that it reported to use all of them.  I thought it'd  
> make one of them a spare (or complain about the odd number of drives).
> 
> How does that work?  (Or is it the "number of drives reported" bug  
> Neil referred to a moment ago?  I use FC6's version of 2.6.18).

If you wanted 6 drives and a spare you need to ask for in: -n6 -x1.
If you asked for 7 drives in a raid10 you get them.
The data is laid out thus:

   A A B B C C D
   D E E F F G G
   H H I I J J K
   K L L M M N N
(each column in a drive, each letter is a chunk of data).

NeilBrown

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-10-05 11:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-05  9:59 converting RAID5 to RAID10 martin f krafft
2006-10-05 10:14 ` Neil Brown
2006-10-05 10:20   ` martin f krafft
2006-10-05 10:15 ` Jurriaan Kalkman
2006-10-05 10:25   ` Ask Bjørn Hansen
2006-10-05 11:34     ` Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).