View Full Version : [ubuntu] Mirror LVM Volume

February 18th, 2009, 07:19 PM
Hi all,

can someone explain me the way to create a mirror on a logigel volume ?

I had created a lvol. Then i extended the volume group with an additional pv. And now i want to create a mirror for the lvol.

I am coming from Unix - and there i use lvextend -m1 ... for createing a mirror.


February 18th, 2009, 08:11 PM
Check out the man page for lvcreate.

lvcreate - create a logical volume in an existing volume group

lvcreate [--addtag Tag] [--alloc AllocationPolicy] [-A/--autobackup
y/n] [-C/--contiguous y/n] [-d/--debug] [-h/-?/--help] [-i/--stripes
Stripes [-I/--stripesize StripeSize]] {-l/--extents LogicalExtentsNum‐
ber[%{VG|PVS|FREE}] |
-L/--size LogicalVolumeSize[kKmMgGtT]} [-M/--persistent y/n] [--minor
minor] [-m/--mirrors Mirrors [--nosync] [--mirrorlog {disk|core}]
[--corelog] [-R/--regionsize MirrorLogRegionSize]] [-n/--name Logi‐
calVolumeName] [-p/--permission r/rw] [-r/--readahead ReadAheadSec‐
tors|auto|none] [-t/--test] [-v/--verbose] [-Z/--zero y/n] VolumeGroup‐
Name [PhysicalVolumePath...]

lvcreate {-l/--extents LogicalExtentsNumber[%{VG|FREE}] |
-L/--size LogicalVolumeSize[kKmMgGtT]} [-c/--chunksize ChunkSize]
-s/--snapshot -n/--name SnapshotLogicalVolumeName OriginalLogicalVol‐


-m, --mirrors Mirrors
Creates a mirrored logical volume with Mirrors copies. For
example, specifying "-m 1" would result in a mirror with two-
sides; that is, a linear volume plus one copy.

Specifying the optional argument --nosync will cause the cre‐
ation of the mirror to skip the initial resynchronization. Any
data written afterwards will be mirrored, but the original con‐
tents will not be copied. This is useful for skipping a poten‐
tially long and resource intensive initial sync of an empty

The optional argument --mirrorlog specifies the type of log to
be used. The default is disk, which is persistent and requires
a small amount of storage space, usually on a separate device
from the data being mirrored. Using core means the mirror is
regenerated by copying the data from the first device again each
time the device is activated, for example, after every reboot.

The optional argument --corelog is equivalent to --mirrorlog

--edit-- or maybe your wanting lvconvert

lvconvert - convert a logical volume from linear to mirror or snapshot

lvconvert -m/--mirrors Mirrors [--mirrorlog {disk|core}] [--corelog]
[-R/--regionsize MirrorLogRegionSize] [-A/--alloc AllocationPolicy]
[-b/--background] [-i/--interval Seconds] [-h/-?/--help] [-v/--verbose]
LogicalVolume[Path] [PhysicalVolume[Path]...]

lvconvert -s/--snapshot [-c/--chunksize ChunkSize] [-h/-?/--help]
[-v/--verbose] [-Z/--zero y/n] [--version]
OriginalLogicalVolume[Path] SnapshotLogicalVolume[Path]


--edit-- oops lol copied and pasted the wrong thing in this spot but you can check out the man page for yourself lol ;)

February 21st, 2009, 08:13 AM