1LVCONVERT(8) System Manager's Manual LVCONVERT(8)
2
3
4
6 lvconvert — convert a logical volume from linear to mirror or snapshot
7
9 lvconvert -m|--mirrors Mirrors [--type SegmentType] [--mirrorlog
10 {disk|core|mirrored}] [--corelog] [-R|--regionsize MirrorLogRegionSize]
11 [--stripes Stripes [-I|--stripesize StripeSize]] [-A|--alloc Alloca‐
12 tionPolicy] [-b|--background] [-f|--force] [-i|--interval Seconds]
13 [--commandprofile ProfileName] [-h|-?|--help] [--noudevsync] [-v|--ver‐
14 bose] [-y|--yes] [--version] LogicalVolume[Path] [PhysicalVol‐
15 ume[Path][:PE[-PE]]...]
16
17 lvconvert --split [--commandprofile ProfileName] [-h|-?|--help]
18 [--noudevsync] [-v|--verbose] SplitableLogicalVolume{Name|Path}
19
20 lvconvert --splitcache|--uncache [--commandprofile ProfileName]
21 [-h|-?|--help] [--noudevsync] [-v|--verbose] [--version] CacheLogi‐
22 calVolume{Name|Path}
23
24 lvconvert --splitmirrors Images [--name SplitLogicalVolumeName]
25 [--trackchanges] MirrorLogicalVolume[Path] [--commandprofile Profile‐
26 Name] [SplittablePhysicalVolume[Path][:PE[-PE]]...]
27
28 lvconvert --splitsnapshot [--commandprofile ProfileName] [-h|-?|--help]
29 [--noudevsync] [-v|--verbose] [--version] SnapshotLogicalVolume[Path]
30
31 lvconvert -s|--snapshot [-c|--chunksize ChunkSize[bBsSkK]] [-Z|--zero
32 {y|n}] [--commandprofile ProfileName] [-h|-?|--help] [--noudevsync]
33 [-v|--verbose] [--version] OriginalLogicalVolume[Path] SnapshotLogi‐
34 calVolume[Path]
35
36 lvconvert --merge [-b|--background] [-i|--interval Seconds] [--command‐
37 profile ProfileName] [-h|-?|--help] [-v|--verbose] [--version] Logi‐
38 calVolume[Path]...
39
40 lvconvert --repair [--stripes Stripes [-I|--stripesize StripeSize]]
41 [--commandprofile ProfileName] [-h|-?|--help] [-v|--verbose] [--ver‐
42 sion] LogicalVolume[Path] [PhysicalVolume[Path]...]
43
44 lvconvert --replace PhysicalVolume [--commandprofile ProfileName]
45 [-h|-?|--help] [-v|--verbose] [--version] LogicalVolume[Path] [Physi‐
46 calVolume[Path]...]
47
48 lvconvert --type thin[-pool]|-T|--thin [--originname NewExternalOrigin‐
49 VolumeName] [--thinpool ThinPoolLogicalVolume{Name|Path} [-c|--chunk‐
50 size ChunkSize[bBsSkKmMgG]] [--discards {ignore|nopassdown|passdown}]
51 [--poolmetadata ThinPoolMetadataLogicalVolume{Name|Path} | --poolmeta‐
52 datasize ThinPoolMetadataSize[bBsSkKmMgG]] [-r|--readahead {ReadAhead‐
53 Sectors|auto|none}] [--stripes Stripes [-I|--stripesize StripeSize]]]
54 [--poolmetadataspare {y|n}] [-Z|--zero {y|n}]] [--commandprofile Pro‐
55 fileName] [-h|-?|--help] [-v|--verbose] [--version] [[ExternalOri‐
56 gin|ThinPool]LogicalVolume{Name|Path}] [PhysicalVolume[Path][:PE
57 [-PE]] ...
58
59 lvconvert --type cache[-pool]|-H|--cache [--cachepool CachePoolLogi‐
60 calVolume{Name|Path}] [-c|--chunksize ChunkSize[bBsSkKmMgG]]
61 [--cachemode {writeback|writethrough}] [--cachepolicy policy]
62 [--cachesettings key=value] [--poolmetadata CachePoolMetadataLogi‐
63 calVolume{Name|Path} | --poolmetadatasize CachePoolMetadata‐
64 Size[bBsSkKmMgG]] [--poolmetadataspare {y|n}] [--commandprofile Pro‐
65 fileName] [-h|-?|--help] [-v|--verbose] [--version] LogicalVol‐
66 ume{Name|Path} [PhysicalVolume[Path][:PE[-PE]]...]
67
68
69
71 lvconvert is used to change the segment type (i.e. linear, mirror, etc)
72 or characteristics of a logical volume. For example, it can add or
73 remove the redundant images of a logical volume, change the log type of
74 a mirror, or designate a logical volume as a snapshot repository.
75 If the conversion requires allocation of physical extents (for example,
76 when converting from linear to mirror) and you specify one or more
77 PhysicalVolumes (optionally with ranges of physical extents), alloca‐
78 tion of physical extents will be restricted to these physical extents.
79 If the conversion frees physical extents (for example, when converting
80 from a mirror to a linear, or reducing mirror legs) and you specify one
81 or more PhysicalVolumes, the freed extents come first from the speci‐
82 fied PhysicalVolumes.
83
85 See lvm(8) for common options.
86 Exactly one of --cache, --corelog, --merge, --mirrorlog, --mirrors,
87 --repair, --replace, --snapshot, --split, --splitcache, --splitsnap‐
88 shot, --splitmirrors, --thin, --type or --uncache arguments is
89 required.
90
91 -b, --background
92 Run the daemon in the background.
93
94 -H, --cache, --type cache
95 Converts logical volume to a cached LV with the use of cache
96 pool specified with --cachepool. For more information on cache
97 pool LVs and cache LVs, see lvmcache(7).
98
99 --cachepolicy policy
100 Only applicable to cached LVs; see also lvmcache(7). Sets the
101 cache policy. mq is the basic policy name. smq is more advanced
102 version available in newer kernels.
103
104 --cachepool CachePoolLV
105 This argument is necessary when converting a logical volume to a
106 cache LV. For more information on cache pool LVs and cache LVs,
107 see lvmcache(7).
108
109 --cachesettings key=value
110 Only applicable to cached LVs; see also lvmcache(7). Sets the
111 cache tunable settings. In most use-cases, default values should
112 be adequate. Special string value default switches setting back
113 to its default kernel value and removes it from the list of set‐
114 tings stored in lvm2 metadata.
115
116 -m, --mirrors Mirrors
117 Specifies the degree of the mirror you wish to create. For
118 example, "-m 1" would convert the original logical volume to a
119 mirror volume with 2-sides; that is, a linear volume plus one
120 copy. There are two implementations of mirroring which corre‐
121 spond to the "raid1" and "mirror" segment types. The default
122 mirroring segment type is "raid1". If the legacy "mirror" seg‐
123 ment type is desired, the --type argument must be used to
124 explicitly select the desired type. The --mirrorlog and
125 --corelog options below are only relevant to the legacy "mirror"
126 segment type.
127
128 --mirrorlog {disk|core|mirrored}
129 Specifies the type of log to use. The default is disk, which is
130 persistent and requires a small amount of storage space, usually
131 on a separate device from the data being mirrored. Core may be
132 useful for short-lived mirrors: It means the mirror is regener‐
133 ated by copying the data from the first device again every time
134 the device is activated - perhaps, for example, after every
135 reboot. Using mirrored will create a persistent log that is
136 itself mirrored.
137
138 --corelog
139 The optional argument --corelog is the same as specifying --mir‐
140 rorlog core.
141
142 -R, --regionsize MirrorLogRegionSize
143 A mirror is divided into regions of this size (in MB), and the
144 mirror log uses this granularity to track which regions are in
145 sync.
146
147 --type SegmentType
148 Used to convert a logical volume to another segment type, like
149 cache, cache-pool, raid1, snapshot, thin, or thin-pool. When
150 converting a logical volume to a cache LV, the --cachepool argu‐
151 ment is required. When converting a logical volume to a thin
152 LV, the --thinpool argument is required. See lvmcache(7) for
153 more info about caching support and lvmthin(7) for thin provi‐
154 sioning support.
155
156 -i, --interval Seconds
157 Report progress as a percentage at regular intervals.
158
159 --noudevsync
160 Disables udev synchronisation. The process will not wait for
161 notification from udev. It will continue irrespective of any
162 possible udev processing in the background. You should only use
163 this if udev is not running or has rules that ignore the devices
164 LVM2 creates.
165
166 --splitmirrors Images
167 The number of redundant Images of a mirror to be split off and
168 used to form a new logical volume. A name must be supplied for
169 the newly-split-off logical volume using the --name argument,
170 unless the --trackchanges argument is given.
171
172 -n, --name Name
173 The name to apply to a logical volume which has been split off
174 from a mirror logical volume.
175
176 --trackchanges
177 Used with --splitmirrors on a raid1 device, this tracks changes
178 so that the read-only detached image can be merged efficiently
179 back into the mirror later. Only the regions of the detached
180 device where the data changed get resynchronized.
181
182 Please note that this feature is only supported with the new md-
183 based mirror implementation and not with the original device-
184 mapper mirror implementation.
185
186 --split
187 Separates SplitableLogicalVolume. Option is agregating various
188 split commands and tries to detect necessary split operation
189 from its arguments.
190
191 --splitcache
192 Separates CacheLogicalVolume from cache pool. Before the logi‐
193 cal volume becomes uncached, cache is flushed. The cache pool
194 volume is then left unused and could be used e.g. for caching
195 another volume. See also the option --uncache for uncaching and
196 removing cache pool with one command.
197
198 --splitsnapshot
199 Separates SnapshotLogicalVolume from its origin. The volume
200 that is split off contains the chunks that differ from the ori‐
201 gin along with the metadata describing them. This volume can be
202 wiped and then destroyed with lvremove. The inverse of --snap‐
203 shot.
204
205 -s, --snapshot, --type snapshot
206 Recreates a snapshot from constituent logical volumes (or copies
207 of them) after having been separated using --splitsnapshot. For
208 this to work correctly, no changes may be made to the contents
209 of either volume after the split.
210
211 -c, --chunksize ChunkSize[bBsSkKmMgG]
212 Gives the size of chunk for snapshot, cache pool and thin pool
213 logical volumes. Default unit is in kilobytes.
214
215 For snapshots the value must be power of 2 between 4KiB and
216 512KiB and the default value is 4.
217
218 For cache pools the value must be between 32KiB and 1GiB and the
219 default value is 64.
220
221 For thin pools the value must be between 64KiB and 1GiB and the
222 default value starts with 64 and scales up to fit the pool meta‐
223 data size within 128MiB, if the pool metadata size is not speci‐
224 fied. The value must be a multiple of 64KiB. (Early kernel
225 support until thin target version 1.4 required the value to be a
226 power of 2. Discards weren't supported for non-power of 2 val‐
227 ues until thin target version 1.5.)
228
229 --discards {ignore|nopassdown|passdown}
230 Specifies whether or not discards will be processed by the thin
231 layer in the kernel and passed down to the Physical Volume.
232 Options is currently supported only with thin pools. Default is
233 passdown.
234
235 -Z, --zero {y|n}
236 Controls zeroing of the first 4KiB of data in the snapshot. If
237 the volume is read-only the snapshot will not be zeroed. For
238 thin pool volumes it controls zeroing of provisioned blocks.
239 Note: Provisioning of large zeroed chunks negatively impacts
240 performance.
241
242 --merge
243 Merges a snapshot into its origin volume or merges a raid1 image
244 that has been split from its mirror with --trackchanges back
245 into its mirror.
246
247 To check if your kernel supports the snapshot merge feature,
248 look for 'snapshot-merge' in the output of dmsetup targets. If
249 both the origin and snapshot volume are not open the merge will
250 start immediately. Otherwise, the merge will start the first
251 time either the origin or snapshot are activated and both are
252 closed. Merging a snapshot into an origin that cannot be
253 closed, for example a root filesystem, is deferred until the
254 next time the origin volume is activated. When merging starts,
255 the resulting logical volume will have the origin's name, minor
256 number and UUID. While the merge is in progress, reads or
257 writes to the origin appear as they were directed to the snap‐
258 shot being merged. When the merge finishes, the merged snapshot
259 is removed. Multiple snapshots may be specified on the command‐
260 line or a @tag may be used to specify multiple snapshots be
261 merged to their respective origin.
262
263 --originname NewExternalOriginVolumeName
264 The new name for original logical volume, which becomes external
265 origin volume for a thin logical volume that will use given
266 --thinpool.
267 Without this option a default name of "lvol<n>" will be gener‐
268 ated where <n> is the LVM internal number of the logical volume.
269 This volume will be read-only and cannot be further modified as
270 long, as it is being used as the external origin.
271
272 --poolmetadata PoolMetadataLogicalVolume{Name|Path}
273 Specifies cache or thin pool metadata logical volume. The size
274 should be in between 2MiB and 16GiB. Cache pool is specified
275 with the option --cachepool. Thin pool is specified with the
276 option --thinpool. When the specified pool already exists, the
277 pool's metadata volume will be swapped with the given LV. Pool
278 properties (like chunk size, discards or zero) are preserved by
279 default in this case. It can be useful for pool metadata repair
280 or its offline resize, since the metadata volume is available as
281 regular volume for a user with thin provisioning tools
282 cache_dump(8), cache_repair(8), cache_restore(8), thin_dump(8),
283 thin_repair(8) and thin_restore(8).
284
285 --poolmetadatasize PoolMetadataSize[bBsSkKmMgG]
286 Sets the size of cache or thin pool's metadata logical volume,
287 if the pool metadata volume is undefined. Pool is specified
288 with the option --cachepool or --thinpool. For thin pool sup‐
289 ported value is in the range between 2MiB and 16GiB. The
290 default value is estimated with this formula (Pool_LV_size /
291 Pool_LV_chunk_size * 64b). Default unit is megabytes.
292
293 --poolmetadataspare {y|n}
294 Controls creation and maintanence of pool metadata spare logical
295 volume that will be used for automated pool recovery. Only one
296 such volume is maintained within a volume group with the size of
297 the biggest pool metadata volume. Default is yes.
298
299 -r, --readahead {ReadAheadSectors|auto|none}
300 Sets read ahead sector count of thin pool metadata logical vol‐
301 ume. The default value is "auto" which allows the kernel to
302 choose a suitable value automatically. "None" is equivalent to
303 specifying zero.
304
305 --repair
306 Repair a mirror after suffering a disk failure or try to fix
307 thin pool metadata.
308
309 The mirror will be brought back into a consistent state. By
310 default, the original number of mirrors will be restored if pos‐
311 sible. Specify -y on the command line to skip the prompts. Use
312 -f if you do not want any replacement. Additionally, you may
313 use --use-policies to use the device replacement policy speci‐
314 fied in lvm.conf(5), viz. activation/mirror_log_fault_policy or
315 activation/mirror_device_fault_policy.
316
317 Thin pool repair automates the use of thin_repair(8) tool. Only
318 inactive thin pool volumes can be repaired. There is no valida‐
319 tion of metadata between kernel and lvm2. This requires further
320 manual work. After successfull repair the old unmodified meta‐
321 data are still available in "<pool>_meta<n>" LV.
322
323 --replace PhysicalVolume
324 Remove the specified device (PhysicalVolume) and replace it with
325 one that is available in the volume group or from the specific
326 list provided. This option is only available to RAID segment
327 types (e.g. raid1, raid5, etc).
328
329 --stripes Stripes
330 Gives the number of stripes. This is equal to the number of
331 physical volumes to scatter the logical volume. This does not
332 apply to existing allocated space, only newly allocated space
333 can be striped.
334
335 -I, --stripesize StripeSize
336 Gives the number of kilobytes for the granularity of the
337 stripes.
338 StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format.
339 For metadata in LVM2 format, the stripe size may be a larger
340 power of 2 but must not exceed the physical extent size.
341
342 -T, --thin, --type thin
343 Converts the logical volume into a thin logical volume of the
344 thin pool specified with --thinpool. The original logical volume
345 ExternalOriginLogicalVolume is renamed into a new read-only log‐
346 ical volume. For the non-default name for this volume use
347 --originname. The volume cannot be further modified as long as
348 it is used as an external origin volume for unprovisioned areas
349 of any thin logical volume.
350
351 --thinpool ThinPoolLogicalVolume{Name|Path}
352 Specifies or converts logical volume into a thin pool's data
353 volume. Content of converted volume is lost. Thin pool's meta‐
354 data logical volume can be specified with the option --poolmeta‐
355 data or allocated with --poolmetadatasize. See lvmthin(7) for
356 more info about thin provisioning support.
357
358 --uncache
359 Uncaches CacheLogicalVolume. Before the volume becomes
360 uncached, cache is flushed. Unlike with --splitcache the cache
361 pool volume is removed. This option could be seen as an inverse
362 of --cache.
363
364
366 Converts the linear logical volume "vg00/lvol1" to a two-way mirror
367 logical volume:
368
369 lvconvert -m1 vg00/lvol1
370
371 Converts the linear logical volume "vg00/lvol1" to a two-way RAID1 log‐
372 ical volume:
373
374 lvconvert --type raid1 -m1 vg00/lvol1
375
376 Converts a mirror with a disk log to a mirror with an in-memory log:
377
378 lvconvert --mirrorlog core vg00/lvol1
379
380 Converts a mirror with an in-memory log to a mirror with a disk log:
381
382 lvconvert --mirrorlog disk vg00/lvol1
383
384 Converts a mirror logical volume to a linear logical volume:
385
386 lvconvert -m0 vg00/lvol1
387
388 Converts a mirror logical volume to a RAID1 logical volume with the
389 same number of images:
390
391 lvconvert --type raid1 vg00/mirror_lv
392
393 Converts logical volume "vg00/lvol2" to snapshot of original volume
394 "vg00/lvol1":
395
396 lvconvert -s vg00/lvol1 vg00/lvol2
397
398 Converts linear logical volume "vg00/lvol1" to a two-way mirror, using
399 physical extents /dev/sda:0-15 and /dev/sdb:0-15 for allocation of new
400 extents:
401
402 lvconvert -m1 vg00/lvol1 /dev/sda:0-15 /dev/sdb:0-15
403
404 Converts mirror logical volume "vg00/lvmirror1" to linear, freeing
405 physical extents from /dev/sda:
406
407 lvconvert -m0 vg00/lvmirror1 /dev/sda
408
409 Merges "vg00/lvol1_snap" into its origin:
410
411 lvconvert --merge vg00/lvol1_snap
412
413 If "vg00/lvol1", "vg00/lvol2" and "vg00/lvol3" are all tagged with
414 "some_tag" each snapshot logical volume will be merged serially, e.g.:
415 "vg00/lvol1", then "vg00/lvol2", then "vg00/lvol3". If --background
416 were used it would start all snapshot logical volume merges in paral‐
417 lel.
418
419 lvconvert --merge @some_tag
420
421 Extracts one image from the mirror, making it a new logical volume
422 named "lv_split". The mirror the image is extracted from is reduced
423 accordingly. If it was a 2-way mirror (created with '-m 1'), then the
424 resulting original volume will be linear.
425
426 lvconvert --splitmirrors 1 --name lv_split vg00/lvmirror1
427
428 A mirrored logical volume created with --type raid1 can use the
429 --trackchanges argument when splitting off an image. Detach one image
430 from the mirrored logical volume lv_raid1 as a separate read-only
431 device and track the changes made to the mirror while it is detached.
432 The split-off device has a name of the form lv_raid1_rimage_N, where N
433 is a number, and it cannot be renamed.
434
435 lvconvert --splitmirrors 1 --trackchanges vg00/lv_raid1
436
437 Merge an image that was detached temporarily from its mirror with the
438 --trackchanges argument back into its original mirror and bring its
439 contents back up-to-date.
440
441 lvconvert --merge vg00/lv_raid1_rimage_1
442
443 Replaces the physical volume "/dev/sdb1" in the RAID1 logical volume
444 "my_raid1" with the specified physical volume "/dev/sdf1". Had the
445 argument "/dev/sdf1" been left out, lvconvert would attempt to find a
446 suitable device from those available in the volume group.
447
448 lvconvert --replace /dev/sdb1 vg00/my_raid1 /dev/sdf1
449
450 Convert the logical volume "vg00/lvpool" into a thin pool with chunk
451 size 128KiB and convert "vg00/lv1" into a thin volume using this pool.
452 Original "vg00/lv1" is used as an external read-only origin, where all
453 writes to such volume are stored in the "vg00/lvpool".
454
455 lvconvert --type thin --thinpool vg00/lvpool -c 128 lv1
456
457 Convert the logical volume "vg00/origin" into a thin volume from the
458 thin pool "vg00/lvpool". This thin volume will use "vg00/origin" as an
459 external origin volume for unprovisioned areas in this volume. For the
460 read-only external origin use the new name "vg00/external".
461
462 lvconvert -T --thinpool vg00/lvpool --originname external vg00/origin
463
464 Convert an existing logical volume to a cache pool LV using the given
465 cache metadata LV.
466
467 lvconvert --type cache-pool --poolmetadata vg00/lvx_meta vg00/lvx_data
468 lvrename vg00/lvx_data vg00/lvx_cachepool
469
470 Convert an existing logical volume to a cache LV using the given cache
471 pool LV and chunk size 128KiB.
472
473 lvconvert --cache --cachepool vg00/lvx_cachepool -c 128 vg00/lvx
474
475 Detach cache pool from an existing cached logical volume "vg00/lvol1"
476 and leave cache pool unused.
477
478 lvconvert --splitcache vg00/lvol1
479
480 Drop cache pool from an existing cached logical volume "vg00/lvol1".
481
482 lvconvert --uncache vg00/lvol1
483
484
486 lvm(8), lvm.conf(5), lvmcache(7), lvmthin(7), lvdisplay(8), lvex‐
487 tend(8), lvreduce(8), lvremove(8), lvrename(8), lvscan(8), vgcreate(8),
488 cache_dump(8), cache_repair(8), cache_restore(8), thin_dump(8),
489 thin_repair(8), thin_restore(8)
490
491
492
493Red Hat, Inc LVM TOOLS 2.02.143(2)-RHEL6 (2016-12-13) LVCONVERT(8)