[linux-lvm] lvcreate --mirror, specifying multiple PVs per copy

Mario Eckl lists at mario-eckl.de
Fri Jan 30 20:48:48 UTC 2009

Am 29.01.2009 um 08:55 schrieb Lupe Christoph:

> Hi!
> I'm still integrating mirrored LVM volumes in our configuration
> management system, and the most recent challenge is a volume that is
> explicitly placed by specifying the PVs the original, the mirror  
> copies,
> and the mirror log reside on.
> lvcreate builds a mirrored volume OK that requires multiple segments  
> per
> copy when you let it determine where to place the segments. But this  
> is
> not acceptable when you have disks that are located in different
> locations for fault tolerance = you must be sure that all the segments
> of a copy reside on disks in a single location.
> The manpage or the command help for lvcreate do not specify the
> algorithm that is used in picking the PVs lvcreate uses for the mirror
> copies or the mirror log.
> I tried "lvcreate --mirror 1 ... testvg PV0a,PV0b PV1a,PV1b PV2" but
> that does not work...
> Please advise. Thank you!
> Lupe Christoph
> -- 
> | There is no substitute for bad design except worse  
> design.                   |
> | / 
> me 
>                                                                           |
> _______________________________________________
> linux-lvm mailing list
> linux-lvm at redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


You can force LVM to place the mirror log on a specific volume like  

   lvcreate -m 1 -n <lv_name> -L <size> testvg /dev/<pv0> /dev/<pv1> / 

The :0 "forces" lvcreate to use only one extent on the specified  
volume, which is not enough for the two mirror legs and only leaves  
the log volume as a possibility (if the size of the logical volume is  
bigger than the extent size).

I hope this helps.

// Mario

More information about the linux-lvm mailing list