1 .TH LVCONVERT 8 "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
3 lvconvert \- convert a logical volume from linear to mirror or snapshot
6 \-m|\-\-mirrors Mirrors [\-\-mirrorlog {disk|core|mirrored}] [\-\-corelog] [\-R|\-\-regionsize MirrorLogRegionSize]
7 [\-A|\-\-alloc AllocationPolicy]
8 [\-b|\-\-background] [\-f|\-\-force] [\-i|\-\-interval Seconds]
10 [\-\-stripes Stripes [\-I|\-\-stripesize StripeSize]]
12 [\-v|\-\-verbose] [\-y|\-\-yes]
15 LogicalVolume[Path] [PhysicalVolume[Path][:PE[-PE]]...]
20 \-\-splitmirrors Images \-\-name SplitLogicalVolumeName
22 MirrorLogicalVolume[Path] [SplittablePhysicalVolume[Path][:PE[-PE]]...]
27 \-s|\-\-snapshot [\-c|\-\-chunksize ChunkSize]
34 OriginalLogicalVolume[Path] SnapshotLogicalVolume[Path]
39 \-\-merge [\-b|\-\-background] [\-i|\-\-interval Seconds]
43 SnapshotLogicalVolume[Path]...
52 LogicalVolume[Path] [PhysicalVolume[Path]...]
54 lvconvert will change a linear logical volume to a mirror
55 logical volume or to a snapshot of linear volume and vice versa.
56 It is also used to add and remove disk logs from mirror devices.
58 If the conversion requires allocation of physical extents (for
59 example, when converting from linear to mirror) and you specify
60 one or more PhysicalVolumes (optionally with ranges of physical
61 extents), allocation of physical extents will be restricted to
62 these physical extents. If the conversion frees physical extents
63 (for example, when converting from a mirror to a linear, or reducing
64 mirror legs) and you specify one or more PhysicalVolumes,
65 the freed extents come first from the specified PhysicalVolumes.
67 See \fBlvm\fP for common options.
69 Exactly one of \-\-splitmirrors, \-\-mirrors, \-\-repair, \-\-snapshot
70 or \-\-merge arguments is required.
73 .I \-m, \-\-mirrors Mirrors
74 Specifies the degree of the mirror you wish to create.
75 For example, "-m 1" would convert the original logical
76 volume to a mirror volume with 2-sides; that is, a
77 linear volume plus one copy.
79 .I \-\-mirrorlog {disk|core|mirrored}
80 Specifies the type of log to use.
81 The default is disk, which is persistent and requires
82 a small amount of storage space, usually on a separate device
83 from the data being mirrored.
84 Core may be useful for short-lived mirrors: It means the mirror is
85 regenerated by copying the data from the first device again every
86 time the device is activated - perhaps, for example, after every reboot.
87 Using "mirrored" will create a persistent log that is itself mirrored.
90 The optional argument "--corelog" is the same as specifying "--mirrorlog core".
92 .I \-R, \-\-regionsize MirrorLogRegionSize
93 A mirror is divided into regions of this size (in MB), and the mirror log
94 uses this granularity to track which regions are in sync.
96 .I \-b, \-\-background
97 Run the daemon in the background.
99 .I \-i, \-\-interval Seconds
100 Report progress as a percentage at regular intervals.
104 Disable udev synchronisation. The
105 process will not wait for notification from udev.
106 It will continue irrespective of any possible udev processing
107 in the background. You should only use this if udev is not running
108 or has rules that ignore the devices LVM2 creates.
113 .I \-\-splitmirrors Images
114 The number of redundant Images of a mirror to be split off and used
115 to form a new logical volume. A name must be supplied for the
116 newly-split-off logical volume using the \-\-name argument.
120 The name to apply to a logical volume which has been split off from
121 a mirror logical volume.
127 Create a snapshot from existing logical volume using another
128 existing logical volume as its origin.
130 .I \-c, \-\-chunksize ChunkSize
131 Power of 2 chunk size for the snapshot logical volume between 4k and 512k.
134 Controls zeroing of the first KB of data in the snapshot.
135 If the volume is read-only the snapshot will not be zeroed.
138 Merges a snapshot into its origin volume. To check if your kernel
139 supports this feature, look for 'snapshot-merge' in the output
140 of 'dmsetup targets'. If both the origin and snapshot volume are not
141 open the merge will start immediately. Otherwise, the merge will start
142 the first time either the origin or snapshot are activated and both are closed.
143 Merging a snapshot into an origin that cannot be closed, for example a root
144 filesystem, is deferred until the next time the origin volume is activated.
145 When merging starts, the resulting logical volume will have the origin's name,
146 minor number and UUID. While the merge is in progress, reads or writes to the
147 origin appear as they were directed to the snapshot being merged. When the
148 merge finishes, the merged snapshot is removed. Multiple snapshots may
149 be specified on the commandline or a @tag may be used to specify
150 multiple snapshots be merged to their respective origin.
156 Repair a mirror after suffering a disk failure. The mirror will be brought back
157 into a consistent state. By default, the original number of mirrors will be
158 restored if possible. Specify \-y on the command line to skip the prompts.
159 Use \-f if you do not want any replacement. Additionally, you may use
160 \-\-use-policies to use the device replacement policy specified in lvm.conf,
161 viz. activation/mirror_log_fault_policy or
162 activation/mirror_device_fault_policy.
165 "lvconvert -m1 vg00/lvol1"
167 converts the linear logical volume "vg00/lvol1" to
168 a two-way mirror logical volume.
170 "lvconvert --mirrorlog core vg00/lvol1"
172 converts a mirror with a disk log to a
173 mirror with an in-memory log.
175 "lvconvert --mirrorlog disk vg00/lvol1"
177 converts a mirror with an in-memory log
178 to a mirror with a disk log.
180 "lvconvert -m0 vg00/lvol1"
182 converts a mirror logical volume to a linear logical
187 "lvconvert -s vg00/lvol1 vg00/lvol2"
189 converts logical volume "vg00/lvol2" to snapshot of original volume "vg00/lvol1"
192 "lvconvert -m1 vg00/lvol1 /dev/sda:0-15 /dev/sdb:0-15"
194 converts linear logical volume "vg00/lvol1" to a two-way mirror, using physical
195 extents /dev/sda:0-15 and /dev/sdb:0-15 for allocation of new extents.
198 "lvconvert -m0 vg00/lvmirror1 /dev/sda
200 converts mirror logical volume "vg00/lvmirror1" to linear, freeing physical
201 extents from /dev/sda.
204 "lvconvert --merge vg00/lvol1_snap"
206 merges "vg00/lvol1_snap" into its origin.
209 "lvconvert --merge @some_tag"
211 If vg00/lvol1, vg00/lvol2, and vg00/lvol3 are all tagged with "some_tag"
212 each snapshot logical volume will be merged serially, e.g.: vg00/lvol1,
213 then vg00/lvol2, then vg00/lvol3. If --background were used it would start
214 all snapshot logical volume merges in parallel.