[GLLUG] Link two RAIDs in one LVM?

Andy Smith andy at bitfolk.com
Mon May 11 10:58:17 UTC 2020


Hello,

On Mon, May 11, 2020 at 10:22:46AM +0100, John Winters via GLLUG wrote:
> On 11/05/2020 10:02, James Roberts via GLLUG wrote:
> >I haven't reviewed all the recent replies, but is there any reason why you
> >can't add the the two new disks of the same size and migrate from RAID 1
> >to RAID 10
> 
> Yes

I actually think it is possible and is a reasonable plan, though
backups will still be advised. I didn't suggest this at first
because initially we thought there were unequal-sized devices (4T
and 8T).

I believe modern mdadm can reshape a RAID-1 into a RAID-0 then a
RAID-0 into a RAID-10 and then add extra devices.

    https://www.berthon.eu/2017/converting-raid1-to-raid10-online/

There will be a scary time when it is RAID-0 and therefore no
redundancy.

My main uncertainty about this is that I'm fairly sure converting
from RAID-1 to RAID-0 leaves you with a RAID-0 of one device and one
marked as spare, then I'm not sure if it does support going to
RAID-10 from that. Should be easy to prove with a test on small
loopback files as block devices though.

Another way it can be done now that we know all the devices are the
same size is to:

1. create a new RAID-10 array that is missing two members.

2. Bring it online, put a filesystem (or LVM) on it,

3. copy data over to it,

4. boot from it making sure that everything works,

5. nuke the old array, add its members to the new RAID-10 thus
making it fully redundant again.

again, for the time period where the second RAID-10 has two members
missing it has no redundancy at all.

If you are very very sure about what you are doing you can do all
that online and only boot into it later but personally I would want
to be satisfied that it booted properly using only the new RAID-10
alone.

This approach is detailed here:

    https://superuser.com/a/726063/100242

> >https://blog.voina.org/convert-an-existing-2-disk-raid-1-to-a-4-disk-raid-10/
> >
> >(though that has LVM on top, shouldn't make a difference in these
> >circumstances,
> 
> You've put your finger on why it won't work in this case.  The presence of
> an existing LVM setup on top of the existing RAID1 is what is used to
> migrate the data over.

Yes, that example uses LVM and is therefore not applicable here.

I think it can be done only with mdadm though.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



More information about the GLLUG mailing list