converting RAID5 to RAID10

converting RAID5 to RAID10

am 05.10.2006 11:59:13 von Martin F Krafft

--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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,

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

--Kj7319i9nmIyA2yE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature (GPG/PGP)
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFJNdxIgvIgzMMSnURAt75AKCbJT/KG7U1B7VWRCyNcTFZaziXegCd EkPV
uAA5yDSRpqu+S4yMjpHTsEE=
=vY4C
-----END PGP SIGNATURE-----

--Kj7319i9nmIyA2yE--
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: converting RAID5 to RAID10

am 05.10.2006 12:14:42 von NeilBrown

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

### 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++;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: converting RAID5 to RAID10

am 05.10.2006 12:15:02 von Jurriaan Kalkman

> 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


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

Re: converting RAID5 to RAID10

am 05.10.2006 12:20:28 von Martin F Krafft

--0F1p//8PRICkK4MW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

also sprach Neil Brown [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.

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

--0F1p//8PRICkK4MW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature (GPG/PGP)
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFJNxsIgvIgzMMSnURAmRyAKCf7FVOrrTf+7cvl5mhT7wSBlXyXQCg lEvW
PnJAxOQ2JrbpVcDCvZQ+su0=
=EWlW
-----END PGP SIGNATURE-----

--0F1p//8PRICkK4MW--
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: converting RAID5 to RAID10

am 05.10.2006 12:25:30 von Ask Bjoern Hansen

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/


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

Re: converting RAID5 to RAID10

am 05.10.2006 13:34:33 von NeilBrown

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
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html