[linux-lvm] Fun and games with mirroring

Stuart D Gathman stuart at bmsi.com
Wed May 23 18:32:58 UTC 2012

On May 23, Les Mikesell transmitted in part:

> I normally want my data on two disks all of the time (and have a large
> pile of failed drives waiting to be destroyed to back up the reasoning
> there...).  But I might tolerate only one fresh copy for the duration
> of testing a possible replacement OS/filesystem.  So in the 'break the
> mirror' case, the copy is already there, and in an instantly usable
> form if I want it back.
> The unfortunate part is that most linux distributions don't allow
> installation on a 'broken mirror' or have a way to convert from
> non-raid to raid after the install the way you can on a windows server
> - or if there is, I haven't found it.  So even if you like the new
> replacement that you tried on the single-disk install, you have to
> throw it away and re-install on raid in the end.

I do this all the time - but with MD raid.  Use custom install, and
create RAID1 MD devices in the install with only 1 leg.  You can add
mirrors later with mdadm.  I also have customers pull out a disk and
send it to me so I can quickly clone their system (while they continue
to operate) on new hardware.  I also routinely add an MD mirror on a new
drive to migrate a PV to new hardware.

It is only the LVM mirroring that isn't doing what you want.

My only complaint with the MD driver is that it doesn't divide up drives
into small partitions.  I often end up creating 2 or 3 partitions on a drive,
and mirroring each.  This allows later distributing them over drives of
unequal size.  E.g., you start out with 2x512G, then later add a 1T,
which you split into 2 partitions big enough to mirror your original
drives, thus doubling your mirrored space with 3 drives.  This kind
of thing would be automatic with a more complete feature set in LVM

It could make sense, however, to add such features to the MD driver,
and keep LVM focused on LVs (and snapshot pools and such) rather than
mirroring.  And that seems to be the way MD + LVM is going now.

More information about the linux-lvm mailing list