1LVCONVERT(8)                System Manager's Manual               LVCONVERT(8)
2
3
4

NAME

6       lvconvert - Change logical volume layout
7

SYNOPSIS

9       lvconvert option_args position_args
10           [ option_args ]
11           [ position_args ]
12
13           --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
14        -b|--background
15        -H|--cache
16           --cachedevice PV
17           --cachemetadataformat auto|1|2
18           --cachemode writethrough|writeback|passthrough
19           --cachepolicy String
20           --cachepool LV
21           --cachesettings String
22           --cachesize Size[m|UNIT]
23           --cachevol LV
24        -c|--chunksize Size[k|UNIT]
25           --commandprofile String
26           --compression y|n
27           --config String
28        -d|--debug
29           --deduplication y|n
30           --discards passdown|nopassdown|ignore
31           --driverloaded y|n
32        -f|--force
33        -h|--help
34        -i|--interval Number
35           --lockopt String
36           --longhelp
37           --merge
38           --mergemirrors
39           --mergesnapshot
40           --mergethin
41           --metadataprofile String
42           --mirrorlog core|disk
43        -m|--mirrors [+|-]Number
44        -n|--name String
45           --nolocking
46           --noudevsync
47           --originname LV
48           --poolmetadata LV
49           --poolmetadatasize Size[m|UNIT]
50           --poolmetadataspare y|n
51           --profile String
52        -q|--quiet
53           --raidintegrity y|n
54           --raidintegrityblocksize Number
55           --raidintegritymode String
56        -r|--readahead auto|none|Number
57        -R|--regionsize Size[m|UNIT]
58           --repair
59           --replace PV
60        -s|--snapshot
61           --splitcache
62           --splitmirrors Number
63           --splitsnapshot
64           --startpoll
65           --stripes Number
66        -I|--stripesize Size[k|UNIT]
67           --swapmetadata
68        -t|--test
69        -T|--thin
70           --thinpool LV
71           --trackchanges
72           --type linear|striped|snapshot|mir‐
73       ror|raid|thin|cache|vdo|thin-pool|cache-pool|vdo-pool
74           --uncache
75           --usepolicies
76           --vdopool LV
77        -v|--verbose
78           --version
79        -V|--virtualsize Size[m|UNIT]
80        -y|--yes
81        -Z|--zero y|n
82

DESCRIPTION

84       lvconvert changes the LV type and includes utilities for LV data  main‐
85       tenance.  The LV type controls data layout and redundancy.  The LV type
86       is also called the segment type or segtype.
87
88       To display the current LV type, run the command:
89
90       lvs -o name,segtype LV
91
92       In some cases, an LV is a single device mapper (dm) layer above  physi‐
93       cal  devices.   In other cases, hidden LVs (dm devices) are layered be‐
94       tween the visible LV and physical devices.  LVs in  the  middle  layers
95       are  called  sub LVs.  A command run on a visible LV sometimes operates
96       on a sub LV rather than the specified LV.  In other  cases,  a  sub  LV
97       must be specified directly on the command line.
98
99       Sub LVs can be displayed with the command:
100
101       lvs -a
102
103       The  linear  type is equivalent to the striped type when one stripe ex‐
104       ists.  In that case, the types can sometimes be used interchangably.
105
106       In most cases, the mirror type is deprecated and the raid1 type  should
107       be used.  They are both implementations of mirroring.
108
109       Striped raid types are raid0/raid0_meta, raid5 (an alias for raid5_ls),
110       raid6 (an alias for raid6_zr) and raid10 (an alias for raid10_near).
111
112       As opposed to mirroring, raid5 and raid6 stripe data and calculate par‐
113       ity  blocks.  The  parity blocks can be used for data block recovery in
114       case devices fail. A maximum number of one device in  a  raid5  LV  may
115       fail, and two in case of raid6. Striped raid types typically rotate the
116       parity and data blocks for  performance  reasons,  thus  avoiding  con‐
117       tention  on  a  single device. Specific arrangements of parity and data
118       blocks (layouts) can be used to optimize I/O performance, or to convert
119       between raid levels.  See lvmraid(7) for more information.
120
121       Layouts  of  raid5  rotating  parity  blocks  can  be:  left-asymmetric
122       (raid5_la), left-symmetric (raid5_ls with alias raid5),  right-asymmet‐
123       ric  (raid5_ra),  right-symmetric (raid5_rs) and raid5_n, which doesn't
124       rotate parity blocks. Layouts of raid6 are: zero-restart (raid6_zr with
125       alias raid6), next-restart (raid6_nr), and next-continue (raid6_nc).
126
127       Layouts  including _n allow for conversion between raid levels (raid5_n
128       to raid6 or raid5_n to striped/raid0/raid0_meta). Additionally, special
129       raid6  layouts  for raid level conversions between raid5 and raid6 are:
130       raid6_ls_6, raid6_rs_6, raid6_la_6 and raid6_ra_6. Those correspond  to
131       their  raid5  counterparts  (e.g. raid5_rs can be directly converted to
132       raid6_rs_6 and vice-versa).
133
134       raid10 (an alias for raid10_near) is currently limited to one data copy
135       and  even number of sub LVs. This is a mirror group layout, thus a sin‐
136       gle sub LV may fail per mirror group without data loss.
137
138       Striped raid types support converting the layout, their stripesize  and
139       their number of stripes.
140
141       The  striped  raid  types combined with raid1 allow for conversion from
142       linear-> striped/raid0/raid0_meta and vice-versa  by  e.g.  linear  <->
143       raid1 <-> raid5_n (then adding stripes) <-> striped/raid0/raid0_meta.
144

USAGE

146       Convert LV to linear.
147
148       lvconvert --type linear LV
149           [ COMMON_OPTIONS ]
150           [ PV ... ]
151       -
152
153       Convert LV to striped.
154
155       lvconvert --type striped LV
156           [ -I|--stripesize Size[k|UNIT] ]
157           [ -R|--regionsize Size[m|UNIT] ]
158           [ -i|--interval Number ]
159           [    --stripes Number ]
160           [ COMMON_OPTIONS ]
161           [ PV ... ]
162       -
163
164       Convert LV to type mirror (also see type raid1),
165
166       lvconvert --type mirror LV
167           [ -m|--mirrors [+|-]Number ]
168           [ -I|--stripesize Size[k|UNIT] ]
169           [ -R|--regionsize Size[m|UNIT] ]
170           [ -i|--interval Number ]
171           [    --stripes Number ]
172           [    --mirrorlog core|disk ]
173           [ COMMON_OPTIONS ]
174           [ PV ... ]
175       -
176
177       Convert LV to raid or change raid layout
178       (a specific raid level must be used, e.g. raid1).
179
180       lvconvert --type raid LV
181           [ -m|--mirrors [+|-]Number ]
182           [ -I|--stripesize Size[k|UNIT] ]
183           [ -R|--regionsize Size[m|UNIT] ]
184           [ -i|--interval Number ]
185           [    --stripes Number ]
186           [ COMMON_OPTIONS ]
187           [ PV ... ]
188       -
189
190       Convert LV to raid1 or mirror, or change number of mirror images.
191
192       lvconvert -m|--mirrors [+|-]Number LV
193           [ -R|--regionsize Size[m|UNIT] ]
194           [ -i|--interval Number ]
195           [    --mirrorlog core|disk ]
196           [ COMMON_OPTIONS ]
197           [ PV ... ]
198       -
199
200       Convert raid LV to change number of stripe images.
201
202       lvconvert --stripes Number LV_raid
203           [ -i|--interval Number ]
204           [ -R|--regionsize Size[m|UNIT] ]
205           [ -I|--stripesize Size[k|UNIT] ]
206           [ COMMON_OPTIONS ]
207           [ PV ... ]
208       -
209
210       Convert raid LV to change the stripe size.
211
212       lvconvert -I|--stripesize Size[k|UNIT] LV_raid
213           [ -i|--interval Number ]
214           [ -R|--regionsize Size[m|UNIT] ]
215           [ COMMON_OPTIONS ]
216       -
217
218       Split images from a raid1 or mirror LV and use them to create a new LV.
219
220       lvconvert --splitmirrors Number -n|--name LV_new LV_cache_mirror_raid1
221           [ COMMON_OPTIONS ]
222           [ PV ... ]
223       -
224
225       Split  images  from  a  raid1  LV and track changes to origin for later
226       merge.
227
228       lvconvert --splitmirrors Number --trackchanges LV_cache_raid1
229           [ COMMON_OPTIONS ]
230           [ PV ... ]
231       -
232
233       Merge LV images that were split from a raid1 LV.
234
235       lvconvert --mergemirrors VG|LV_linear_raid|Tag ...
236           [ COMMON_OPTIONS ]
237       -
238
239       Convert LV to a thin LV, using the original LV as an external origin.
240
241       lvconvert --type thin --thinpool LV LV_linear_striped_thin_cache_raid
242           [ -T|--thin ]
243           [ -r|--readahead auto|none|Number ]
244           [ -c|--chunksize Size[k|UNIT] ]
245           [ -Z|--zero y|n ]
246           [    --originname LV_new ]
247           [    --poolmetadata LV ]
248           [    --poolmetadatasize Size[m|UNIT] ]
249           [    --poolmetadataspare y|n ]
250           [    --metadataprofile String ]
251           [ COMMON_OPTIONS ]
252       -
253
254       Attach a cache pool to an LV, converts the LV to type cache.
255
256       lvconvert   --type   cache   --cachepool   LV   LV_linear_striped_thin‐
257       pool_vdo_vdopool_vdopooldata_raid
258           [ -H|--cache ]
259           [ -Z|--zero y|n ]
260           [ -r|--readahead auto|none|Number ]
261           [ -c|--chunksize Size[k|UNIT] ]
262           [    --cachemetadataformat auto|1|2 ]
263           [    --cachemode writethrough|writeback|passthrough ]
264           [    --cachepolicy String ]
265           [    --cachesettings String ]
266           [    --poolmetadata LV ]
267           [    --poolmetadatasize Size[m|UNIT] ]
268           [    --poolmetadataspare y|n ]
269           [    --metadataprofile String ]
270           [ COMMON_OPTIONS ]
271       -
272
273       Attach a writecache to an LV, converts the LV to type writecache.
274
275       lvconvert --type writecache --cachevol LV LV_linear_striped_raid
276           [    --cachesettings String ]
277           [ COMMON_OPTIONS ]
278       -
279
280       Attach a cache to an LV, converts the LV to type cache.
281
282       lvconvert --type cache --cachevol LV LV_linear_striped_thinpool_raid
283           [ -H|--cache ]
284           [ -Z|--zero y|n ]
285           [ -c|--chunksize Size[k|UNIT] ]
286           [    --cachemetadataformat auto|1|2 ]
287           [    --cachemode writethrough|writeback|passthrough ]
288           [    --cachepolicy String ]
289           [    --cachesettings String ]
290           [    --poolmetadatasize Size[m|UNIT] ]
291           [ COMMON_OPTIONS ]
292       -
293
294       Add a writecache to an LV, using a specified cache device.
295
296       lvconvert --type writecache --cachedevice PV LV_linear_striped_raid
297           [    --cachesize Size[m|UNIT] ]
298           [    --cachesettings String ]
299           [ COMMON_OPTIONS ]
300       -
301
302       Add a cache to an LV, using a specified cache device.
303
304       lvconvert --type cache --cachedevice PV LV_linear_striped_thinpool_raid
305           [ -c|--chunksize Size[k|UNIT] ]
306           [    --cachesize Size[m|UNIT] ]
307           [    --cachesettings String ]
308           [ COMMON_OPTIONS ]
309       -
310
311       Convert LV to type thin-pool.
312
313       lvconvert --type thin-pool LV_linear_striped_cache_raid
314           [ -I|--stripesize Size[k|UNIT] ]
315           [ -r|--readahead auto|none|Number ]
316           [ -c|--chunksize Size[k|UNIT] ]
317           [ -Z|--zero y|n ]
318           [    --stripes Number ]
319           [    --discards passdown|nopassdown|ignore ]
320           [    --poolmetadata LV ]
321           [    --poolmetadatasize Size[m|UNIT] ]
322           [    --poolmetadataspare y|n ]
323           [    --metadataprofile String ]
324           [ COMMON_OPTIONS ]
325           [ PV ... ]
326       -
327
328       Convert LV to type cache-pool.
329
330       lvconvert --type cache-pool LV_linear_striped_raid
331           [ -Z|--zero y|n ]
332           [ -r|--readahead auto|none|Number ]
333           [ -c|--chunksize Size[k|UNIT] ]
334           [    --cachemetadataformat auto|1|2 ]
335           [    --cachemode writethrough|writeback|passthrough ]
336           [    --cachepolicy String ]
337           [    --cachesettings String ]
338           [    --poolmetadata LV ]
339           [    --poolmetadatasize Size[m|UNIT] ]
340           [    --poolmetadataspare y|n ]
341           [    --metadataprofile String ]
342           [ COMMON_OPTIONS ]
343           [ PV ... ]
344       -
345
346       Convert LV to type vdopool.
347
348       lvconvert --type vdo-pool LV_linear_striped_cache_raid
349           [ -n|--name LV_new ]
350           [ -V|--virtualsize Size[m|UNIT] ]
351           [    --compression y|n ]
352           [    --deduplication y|n ]
353           [ COMMON_OPTIONS ]
354       -
355
356       Detach a cache from an LV.
357
358       lvconvert --splitcache LV_thinpool_cache_cachepool_vdopool_writecache
359           [    --cachesettings String ]
360           [ COMMON_OPTIONS ]
361       -
362
363       Merge thin LV into its origin LV.
364
365       lvconvert --mergethin LV_thin ...
366           [ COMMON_OPTIONS ]
367       -
368
369       Merge COW snapshot LV into its origin.
370
371       lvconvert --mergesnapshot LV_snapshot ...
372           [ -i|--interval Number ]
373           [ COMMON_OPTIONS ]
374       -
375
376       Combine a former COW snapshot (second arg) with a former
377       origin LV (first arg) to reverse a splitsnapshot command.
378
379       lvconvert --type snapshot LV LV_linear_striped
380           [ -s|--snapshot ]
381           [ -c|--chunksize Size[k|UNIT] ]
382           [ -Z|--zero y|n ]
383           [ COMMON_OPTIONS ]
384       -
385
386       Replace failed PVs in a raid or mirror LV.
387       Repair a thin pool.
388       Repair a cache pool.
389
390       lvconvert --repair LV_thinpool_cache_cachepool_mirror_raid
391           [ -i|--interval Number ]
392           [    --usepolicies ]
393           [    --poolmetadataspare y|n ]
394           [ COMMON_OPTIONS ]
395           [ PV ... ]
396       -
397
398       Replace specific PV(s) in a raid LV with another PV.
399
400       lvconvert --replace PV LV_raid
401           [ COMMON_OPTIONS ]
402           [ PV ... ]
403       -
404
405       Poll LV to continue conversion.
406
407       lvconvert --startpoll LV_mirror_raid
408           [ COMMON_OPTIONS ]
409       -
410
411       Add or remove data integrity checksums to raid images.
412
413       lvconvert --raidintegrity y|n LV_raid
414           [    --raidintegritymode String ]
415           [    --raidintegrityblocksize Number ]
416           [ COMMON_OPTIONS ]
417           [ PV ... ]
418       -
419
420       Common options for command:
421           [ -b|--background ]
422           [ -f|--force ]
423           [    --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
424           ]
425           [    --noudevsync ]
426
427       Common options for lvm:
428           [ -d|--debug ]
429           [ -h|--help ]
430           [ -q|--quiet ]
431           [ -t|--test ]
432           [ -v|--verbose ]
433           [ -y|--yes ]
434           [    --commandprofile String ]
435           [    --config String ]
436           [    --driverloaded y|n ]
437           [    --lockopt String ]
438           [    --longhelp ]
439           [    --nolocking ]
440           [    --profile String ]
441           [    --version ]
442

OPTIONS

444       --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
445              Determines the allocation policy when a command needs to allo‐
446              cate Physical Extents (PEs) from the VG. Each VG and LV has an
447              allocation policy which can be changed with vgchange/lvchange,
448              or overriden on the command line.  normal applies common sense
449              rules such as not placing parallel stripes on the same PV.  in‐
450              herit applies the VG policy to an LV.  contiguous requires new
451              PEs be placed adjacent to existing PEs.  cling places new PEs on
452              the same PV as existing PEs in the same stripe of the LV.  If
453              there are sufficient PEs for an allocation, but normal does not
454              use them, anywhere will use them even if it reduces performance,
455              e.g. by placing two stripes on the same PV.  Optional positional
456              PV args on the command line can also be used to limit which PVs
457              the command will use for allocation.  See lvm(8) for more infor‐
458              mation about allocation.
459
460       -b|--background
461              If the operation requires polling, this option causes the com‐
462              mand to return before the operation is complete, and polling is
463              done in the background.
464
465       -H|--cache
466              Specifies the command is handling a cache LV or cache pool.  See
467              --type cache and --type cache-pool.  See lvmcache(7) for more
468              information about LVM caching.
469
470       --cachedevice PV
471              The name of a device to use for a cache.
472
473       --cachemetadataformat auto|1|2
474              Specifies the cache metadata format used by cache target.
475
476       --cachemode writethrough|writeback|passthrough
477              Specifies when writes to a cache LV should be considered com‐
478              plete.  writeback considers a write complete as soon as it is
479              stored in the cache pool.  writethough considers a write com‐
480              plete only when it has been stored in both the cache pool and on
481              the origin LV.  While writethrough may be slower for writes, it
482              is more resilient if something should happen to a device associ‐
483              ated with the cache pool LV. With passthrough, all reads are
484              served from the origin LV (all reads miss the cache) and all
485              writes are forwarded to the origin LV; additionally, write hits
486              cause cache block invalidates. See lvmcache(7) for more informa‐
487              tion.
488
489       --cachepolicy String
490              Specifies the cache policy for a cache LV.  See lvmcache(7) for
491              more information.
492
493       --cachepool LV
494              The name of a cache pool.
495
496       --cachesettings String
497              Specifies tunable values for a cache LV in "Key = Value" form.
498              Repeat this option to specify multiple values.  (The default
499              values should usually be adequate.)  The special string value
500              default switches settings back to their default kernel values
501              and removes them from the list of settings stored in LVM meta‐
502              data.  See lvmcache(7) for more information.
503
504       --cachesize Size[m|UNIT]
505              The size of cache to use.
506
507       --cachevol LV
508              The name of a cache volume.
509
510       -c|--chunksize Size[k|UNIT]
511              The size of chunks in a snapshot, cache pool or thin pool.  For
512              snapshots, the value must be a power of 2 between 4KiB and
513              512KiB and the default value is 4.  For a cache pool the value
514              must be between 32KiB and 1GiB and the default value is 64.  For
515              a thin pool the value must be between 64KiB and 1GiB and the de‐
516              fault value starts with 64 and scales up to fit the pool meta‐
517              data size within 128MiB, if the pool metadata size is not speci‐
518              fied.  The value must be a multiple of 64KiB.  See lvmthin(7)
519              and lvmcache(7) for more information.
520
521       --commandprofile String
522              The command profile to use for command configuration.  See
523              lvm.conf(5) for more information about profiles.
524
525       --compression y|n
526              Controls whether compression is enabled or disable for VDO vol‐
527              ume.  See lvmvdo(7) for more information about VDO usage.
528
529       --config String
530              Config settings for the command. These override lvm.conf set‐
531              tings.  The String arg uses the same format as lvm.conf, or may
532              use section/field syntax.  See lvm.conf(5) for more information
533              about config.
534
535       -d|--debug ...
536              Set debug level. Repeat from 1 to 6 times to increase the detail
537              of messages sent to the log file and/or syslog (if configured).
538
539       --deduplication y|n
540              Controls whether deduplication is enabled or disable for VDO
541              volume.  See lvmvdo(7) for more information about VDO usage.
542
543       --discards passdown|nopassdown|ignore
544              Specifies how the device-mapper thin pool layer in the kernel
545              should handle discards.  ignore causes the thin pool to ignore
546              discards.  nopassdown causes the thin pool to process discards
547              itself to allow reuse of unneeded extents in the thin pool.
548              passdown causes the thin pool to process discards itself (like
549              nopassdown) and pass the discards to the underlying device.  See
550              lvmthin(7) for more information.
551
552       --driverloaded y|n
553              If set to no, the command will not attempt to use device-mapper.
554              For testing and debugging.
555
556       -f|--force ...
557              Override various checks, confirmations and protections.  Use
558              with extreme caution.
559
560       -h|--help
561              Display help text.
562
563       -i|--interval Number
564              Report progress at regular intervals.
565
566       --lockopt String
567              Used to pass options for special cases to lvmlockd.  See lvm‐
568              lockd(8) for more information.
569
570       --longhelp
571              Display long help text.
572
573       --merge
574              An alias for --mergethin, --mergemirrors, or --mergesnapshot,
575              depending on the type of LV.
576
577       --mergemirrors
578              Merge LV images that were split from a raid1 LV.  See --split‐
579              mirrors with --trackchanges.
580
581       --mergesnapshot
582              Merge COW snapshot LV into its origin.  When merging a snapshot,
583              if both the origin and snapshot LVs are not open, the merge will
584              start immediately. Otherwise, the merge will start the first
585              time either the origin or snapshot LV are activated and both are
586              closed. Merging a snapshot into an origin that cannot be closed,
587              for example a root filesystem, is deferred until the next time
588              the origin volume is activated. When merging starts, the result‐
589              ing LV will have the origin's name, minor number and UUID. While
590              the merge is in progress, reads or writes to the origin appear
591              as being directed to the snapshot being merged. When the merge
592              finishes, the merged snapshot is removed.  Multiple snapshots
593              may be specified on the command line or a @tag may be used to
594              specify multiple snapshots be merged to their respective origin.
595
596       --mergethin
597              Merge thin LV into its origin LV.  The origin thin LV takes the
598              content of the thin snapshot, and the thin snapshot LV is re‐
599              moved.  See lvmthin(7) for more information.
600
601       --metadataprofile String
602              The metadata profile to use for command configuration.  See
603              lvm.conf(5) for more information about profiles.
604
605       --mirrorlog core|disk
606              Specifies the type of mirror log for LVs with the "mirror" type
607              (does not apply to the "raid1" type.)  disk is a persistent log
608              and requires a small amount of storage space, usually on a sepa‐
609              rate device from the data being mirrored.  core is not persis‐
610              tent; the log is kept only in memory.  In this case, the mirror
611              must be synchronized (by copying LV data from the first device
612              to others) each time the LV is activated, e.g. after reboot.
613              mirrored is a persistent log that is itself mirrored, but should
614              be avoided. Instead, use the raid1 type for log redundancy.
615
616       -m|--mirrors [+|-]Number
617              Specifies the number of mirror images in addition to the origi‐
618              nal LV image, e.g. --mirrors 1 means there are two images of the
619              data, the original and one mirror image.  Optional positional PV
620              args on the command line can specify the devices the images
621              should be placed on.  There are two mirroring implementations:
622              "raid1" and "mirror".  These are the names of the corresponding
623              LV types, or "segment types".  Use the --type option to specify
624              which to use (raid1 is default, and mirror is legacy) Use
625              lvm.conf global/mirror_segtype_default and global/raid10_seg‐
626              type_default to configure the default types.  The plus prefix +
627              can be used, in which case the number is added to the current
628              number of images, or the minus prefix - can be used, in which
629              case the number is subtracted from the current number of images.
630              See lvmraid(7) for more information.
631
632       -n|--name String
633              Specifies the name of a new LV.  When unspecified, a default
634              name of "lvol#" is generated, where # is a number generated by
635              LVM.
636
637       --nolocking
638              Disable locking.
639
640       --noudevsync
641              Disables udev synchronisation. The process will not wait for no‐
642              tification from udev. It will continue irrespective of any pos‐
643              sible udev processing in the background. Only use this if udev
644              is not running or has rules that ignore the devices LVM creates.
645
646       --originname LV
647              Specifies the name to use for the external origin LV when con‐
648              verting an LV to a thin LV. The LV being converted becomes a
649              read-only external origin with this name.
650
651       --poolmetadata LV
652              The name of a an LV to use for storing pool metadata.
653
654       --poolmetadatasize Size[m|UNIT]
655              Specifies the size of the new pool metadata LV.
656
657       --poolmetadataspare y|n
658              Enable or disable the automatic creation and management of a
659              spare pool metadata LV in the VG. A spare metadata LV is re‐
660              served space that can be used when repairing a pool.
661
662       --profile String
663              An alias for --commandprofile or --metadataprofile, depending on
664              the command.
665
666       -q|--quiet ...
667              Suppress output and log messages. Overrides --debug and --ver‐
668              bose.  Repeat once to also suppress any prompts with answer
669              'no'.
670
671       --raidintegrity y|n
672              Enable or disable data integrity checksums for raid images.
673
674       --raidintegrityblocksize Number
675              The block size to use for dm-integrity on raid images.  The in‐
676              tegrity block size should usually match the device logical block
677              size, or the file system block size.  It may be less than the
678              file system block size, but not less than the device logical
679              block size.  Possible values: 512, 1024, 2048, 4096.
680
681       --raidintegritymode String
682              Use a journal (default) or bitmap for keeping integrity check‐
683              sums consistent in case of a crash. The bitmap areas are recal‐
684              culated after a crash, so corruption in those areas would not be
685              detected. A journal does not have this problem.  The journal
686              mode doubles writes to storage, but can improve performance for
687              scattered writes packed into a single journal write.  bitmap
688              mode can in theory achieve full write throughput of the device,
689              but would not benefit from the potential scattered write opti‐
690              mization.
691
692       -r|--readahead auto|none|Number
693              Sets read ahead sector count of an LV.  auto is the default
694              which allows the kernel to choose a suitable value automati‐
695              cally.  none is equivalent to zero.
696
697       -R|--regionsize Size[m|UNIT]
698              Size of each raid or mirror synchronization region.  lvm.conf
699              activation/raid_region_size can be used to configure a default.
700
701       --repair
702              Replace failed PVs in a raid or mirror LV, or run a repair util‐
703              ity on a thin pool. See lvmraid(7) and lvmthin(7) for more in‐
704              formation.
705
706       --replace PV
707              Replace a specific PV in a raid LV with another PV.  The new PV
708              to use can be optionally specified after the LV.  Multiple PVs
709              can be replaced by repeating this option.  See lvmraid(7) for
710              more information.
711
712       -s|--snapshot
713              Combine a former COW snapshot LV with a former origin LV to re‐
714              verse a previous --splitsnapshot command.
715
716       --splitcache
717              Separates a cache pool from a cache LV, and keeps the unused
718              cache pool LV.  Before the separation, the cache is flushed.
719              Also see --uncache.
720
721       --splitmirrors Number
722              Splits the specified number of images from a raid1 or mirror LV
723              and uses them to create a new LV. If --trackchanges is also
724              specified, changes to the raid1 LV are tracked while the split
725              LV remains detached.  If --name is specified, then the images
726              are permanently split from the original LV and changes are not
727              tracked.
728
729       --splitsnapshot
730              Separates a COW snapshot from its origin LV. The LV that is
731              split off contains the chunks that differ from the origin LV
732              along with metadata describing them. This LV can be wiped and
733              then destroyed with lvremove.
734
735       --startpoll
736              Start polling an LV to continue processing a conversion.
737
738       --stripes Number
739              Specifies the number of stripes in a striped LV. This is the
740              number of PVs (devices) that a striped LV is spread across. Data
741              that appears sequential in the LV is spread across multiple de‐
742              vices in units of the stripe size (see --stripesize). This does
743              not apply to existing allocated space, only newly allocated
744              space can be striped.
745
746       -I|--stripesize Size[k|UNIT]
747              The amount of data that is written to one device before moving
748              to the next in a striped LV.
749
750       --swapmetadata
751              Extracts the metadata LV from a pool and replaces it with an‐
752              other specified LV.  The extracted LV is preserved and given the
753              name of the LV that replaced it.  Use for repair only. When the
754              metadata LV is swapped out of the pool, it can be activated di‐
755              rectly and used with thin provisioning tools: cache_dump(8),
756              cache_repair(8), cache_restore(8), thin_dump(8), thin_repair(8),
757              thin_restore(8).
758
759       -t|--test
760              Run in test mode. Commands will not update metadata.  This is
761              implemented by disabling all metadata writing but nevertheless
762              returning success to the calling function. This may lead to un‐
763              usual error messages in multi-stage operations if a tool relies
764              on reading back metadata it believes has changed but hasn't.
765
766       -T|--thin
767              Specifies the command is handling a thin LV or thin pool.  See
768              --type thin, --type thin-pool, and --virtualsize.  See
769              lvmthin(7) for more information about LVM thin provisioning.
770
771       --thinpool LV
772              The name of a thin pool LV.
773
774       --trackchanges
775              Can be used with --splitmirrors on a raid1 LV. This causes
776              changes to the original raid1 LV to be tracked while the split
777              images remain detached. This is a temporary state that allows
778              the read-only detached image to be merged efficiently back into
779              the raid1 LV later.  Only the regions with changed data are
780              resynchronized during merge.  While a raid1 LV is tracking
781              changes, operations on it are limited to merging the split image
782              (see --mergemirrors) or permanently splitting the image (see
783              --splitmirrors with --name.
784
785       --type linear|striped|snapshot|mir‐
786              ror|raid|thin|cache|vdo|thin-pool|cache-pool|vdo-pool
787              The LV type, also known as "segment type" or "segtype".  See us‐
788              age descriptions for the specific ways to use these types.  For
789              more information about redundancy and performance (raid<N>, mir‐
790              ror, striped, linear) see lvmraid(7).  For thin provisioning
791              (thin, thin-pool) see lvmthin(7).  For performance caching
792              (cache, cache-pool) see lvmcache(7).  For copy-on-write snap‐
793              shots (snapshot) see usage definitions.  For VDO (vdo) see
794              lvmvdo(7).  Several commands omit an explicit type option be‐
795              cause the type is inferred from other options or shortcuts (e.g.
796              --stripes, --mirrors, --snapshot, --virtualsize, --thin,
797              --cache, --vdo).  Use inferred types with care because it can
798              lead to unexpected results.
799
800       --uncache
801              Separates a cache pool from a cache LV, and deletes the unused
802              cache pool LV.  Before the separation, the cache is flushed.
803              Also see --splitcache.
804
805       --usepolicies
806              Perform an operation according to the policy configured in
807              lvm.conf or a profile.
808
809       --vdopool LV
810              The name of a VDO pool LV.  See lvmvdo(7) for more information
811              about VDO usage.
812
813       -v|--verbose ...
814              Set verbose level. Repeat from 1 to 4 times to increase the de‐
815              tail of messages sent to stdout and stderr.
816
817       --version
818              Display version information.
819
820       -V|--virtualsize Size[m|UNIT]
821              The virtual size of a new thin LV.  See lvmthin(7) for more in‐
822              formation about LVM thin provisioning.  Using virtual size (-V)
823              and actual size (-L) together creates a sparse LV.  lvm.conf
824              global/sparse_segtype_default determines the default segment
825              type used to create a sparse LV.  Anything written to a sparse
826              LV will be returned when reading from it.  Reading from other
827              areas of the LV will return blocks of zeros.  When using a snap‐
828              shot to create a sparse LV, a hidden virtual device is created
829              using the zero target, and the LV has the suffix _vorigin.
830              Snapshots are less efficient than thin provisioning when creat‐
831              ing large sparse LVs (GiB).
832
833       -y|--yes
834              Do not prompt for confirmation interactively but always assume
835              the answer yes. Use with extreme caution.  (For automatic no,
836              see -qq.)
837
838       -Z|--zero y|n
839              For snapshots, this controls zeroing of the first 4KiB of data
840              in the snapshot. If the LV is read-only, the snapshot will not
841              be zeroed.  For thin pools, this controls zeroing of provisioned
842              blocks.  Provisioning of large zeroed chunks negatively impacts
843              performance.
844

VARIABLES

846       VG
847              Volume Group name.  See lvm(8) for valid names.
848
849       LV
850              Logical  Volume  name.  See lvm(8) for valid names.  An LV posi‐
851              tional arg generally includes the VG  name  and  LV  name,  e.g.
852              VG/LV.  LV followed by _<type> indicates that an LV of the given
853              type is required. (raid represents raid<N> type)
854
855       PV
856              Physical Volume name, a device path under  /dev.   For  commands
857              managing physical extents, a PV positional arg generally accepts
858              a suffix indicating a range (or multiple ranges) of physical ex‐
859              tents  (PEs).  When  the first PE is omitted, it defaults to the
860              start of the device, and when the last PE is omitted it defaults
861              to  end.   Start and end range (inclusive): PV[:PE-PE]...  Start
862              and length range (counting from 0): PV[:PE+PE]...
863
864       Tag
865              Tag name.  See lvm(8) for information about tag names and  using
866              tags in place of a VG, LV or PV.
867
868       String
869              See the option description for information about the string con‐
870              tent.
871
872       Size[UNIT]
873              Size is an input number that accepts an  optional  unit.   Input
874              units are always treated as base two values, regardless of capi‐
875              talization, e.g. 'k' and 'K' both refer to  1024.   The  default
876              input unit is specified by letter, followed by |UNIT.  UNIT rep‐
877              resents other possible input units:  bBsSkKmMgGtTpPeE.   b|B  is
878              bytes,  s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G
879              is GiB, t|T is TiB, p|P is PiB, e|E is EiB.  (This should not be
880              confused  with the output control --units, where capital letters
881              mean multiple of 1000.)
882

ENVIRONMENT VARIABLES

884       See lvm(8) for information about environment  variables  used  by  lvm.
885       For example, LVM_VG_NAME can generally be substituted for a required VG
886       parameter.
887

ADVANCED USAGE

889       Alternate command forms, advanced command usage,  and  listing  of  all
890       valid syntax for completeness.
891
892       Change the region size of an LV.
893
894       lvconvert -R|--regionsize Size[m|UNIT] LV_raid
895           [ COMMON_OPTIONS ]
896       -
897
898       Change the type of mirror log used by a mirror LV.
899
900       lvconvert --mirrorlog core|disk LV_mirror
901           [ COMMON_OPTIONS ]
902           [ PV ... ]
903       -
904
905       Convert LV to a thin LV, using the original LV as an external origin
906       (infers --type thin).
907
908       lvconvert -T|--thin --thinpool LV LV_linear_striped_thin_cache_raid
909           [ -r|--readahead auto|none|Number ]
910           [ -c|--chunksize Size[k|UNIT] ]
911           [ -Z|--zero y|n ]
912           [    --type thin ]
913           [    --originname LV_new ]
914           [    --poolmetadata LV ]
915           [    --poolmetadatasize Size[m|UNIT] ]
916           [    --poolmetadataspare y|n ]
917           [    --metadataprofile String ]
918           [ COMMON_OPTIONS ]
919       -
920
921       Attach a cache pool to an LV (infers --type cache).
922
923       lvconvert    -H|--cache    --cachepool    LV    LV_linear_striped_thin‐
924       pool_vdo_vdopool_vdopooldata_raid
925           [ -Z|--zero y|n ]
926           [ -r|--readahead auto|none|Number ]
927           [ -c|--chunksize Size[k|UNIT] ]
928           [    --type cache ]
929           [    --cachemetadataformat auto|1|2 ]
930           [    --cachemode writethrough|writeback|passthrough ]
931           [    --cachepolicy String ]
932           [    --cachesettings String ]
933           [    --poolmetadata LV ]
934           [    --poolmetadatasize Size[m|UNIT] ]
935           [    --poolmetadataspare y|n ]
936           [    --metadataprofile String ]
937           [ COMMON_OPTIONS ]
938       -
939
940       Attach a cache to an LV, converts the LV to type cache.
941
942       lvconvert -H|--cache --cachevol LV LV_linear_striped_thinpool_raid
943           [ -Z|--zero y|n ]
944           [ -c|--chunksize Size[k|UNIT] ]
945           [    --cachemetadataformat auto|1|2 ]
946           [    --cachemode writethrough|writeback|passthrough ]
947           [    --cachepolicy String ]
948           [    --cachesettings String ]
949           [    --poolmetadatasize Size[m|UNIT] ]
950           [ COMMON_OPTIONS ]
951       -
952
953       Convert LV to type vdopool.
954
955       lvconvert --vdopool LV_linear_striped_cache_raid
956           [ -n|--name LV_new ]
957           [ -V|--virtualsize Size[m|UNIT] ]
958           [    --type vdo-pool ]
959           [    --compression y|n ]
960           [    --deduplication y|n ]
961           [ COMMON_OPTIONS ]
962       -
963
964       Detach and delete a cache from an LV.
965
966       lvconvert --uncache LV_thinpool_cache_vdopool_writecache
967           [    --cachesettings String ]
968           [ COMMON_OPTIONS ]
969       -
970
971       Swap metadata LV in a thin pool or cache pool (for repair only).
972
973       lvconvert --swapmetadata --poolmetadata LV LV_thinpool_cachepool
974           [ -c|--chunksize Size[k|UNIT] ]
975           [ COMMON_OPTIONS ]
976       -
977
978       Merge LV that was split from a mirror (variant, use --mergemirrors).
979       Merge thin LV into its origin LV (variant, use --mergethin).
980       Merge COW snapshot LV into its origin (variant, use --mergesnapshot).
981
982       lvconvert --merge VG|LV_linear_striped_snapshot_thin_raid|Tag ...
983           [ -i|--interval Number ]
984           [ COMMON_OPTIONS ]
985       -
986
987       Separate a COW snapshot from its origin LV.
988
989       lvconvert --splitsnapshot LV_snapshot
990           [ COMMON_OPTIONS ]
991       -
992
993       Combine a former COW snapshot (second arg) with a former
994       origin LV (first arg) to reverse a splitsnapshot command.
995
996       lvconvert -s|--snapshot LV LV_linear_striped
997           [ -c|--chunksize Size[k|UNIT] ]
998           [ -Z|--zero y|n ]
999           [    --type snapshot ]
1000           [ COMMON_OPTIONS ]
1001       -
1002
1003       Poll LV to continue conversion (also see --startpoll)
1004       or waits till conversion/mirror syncing is finished
1005
1006       lvconvert LV_mirror_raid
1007           [ COMMON_OPTIONS ]
1008       -
1009
1010

NOTES

1012       This previous command syntax would perform two different operations:
1013       lvconvert --thinpool LV1 --poolmetadata LV2
1014       If LV1 was not a thin pool, the command would convert  LV1  to  a  thin
1015       pool,  optionally  using  a specified LV for metadata.  But, if LV1 was
1016       already a thin pool, the command would swap  the  current  metadata  LV
1017       with LV2 (for repair purposes.)
1018
1019       In the same way, this previous command syntax would perform two differ‐
1020       ent operations:
1021       lvconvert --cachepool LV1 --poolmetadata LV2
1022       If LV1 was not a cache pool, the command would convert LV1 to  a  cache
1023       pool,  optionally  using  a specified LV for metadata.  But, if LV1 was
1024       already a cache pool, the command would swap the  current  metadata  LV
1025       with LV2 (for repair purposes.)
1026

EXAMPLES

1028       Convert a linear LV to a two-way mirror LV.
1029       lvconvert --type mirror --mirrors 1 vg/lvol1
1030
1031       Convert a linear LV to a two-way RAID1 LV.
1032       lvconvert --type raid1 --mirrors 1 vg/lvol1
1033
1034       Convert a mirror LV to use an in-memory log.
1035       lvconvert --mirrorlog core vg/lvol1
1036
1037       Convert a mirror LV to use a disk log.
1038       lvconvert --mirrorlog disk vg/lvol1
1039
1040       Convert a mirror or raid1 LV to a linear LV.
1041       lvconvert --type linear vg/lvol1
1042
1043       Convert a mirror LV to a raid1 LV with the same number of images.
1044       lvconvert --type raid1 vg/lvol1
1045
1046       Convert a linear LV to a two-way mirror LV, allocating new extents from
1047       specific PV ranges.
1048       lvconvert --mirrors 1 vg/lvol1 /dev/sda:0-15 /dev/sdb:0-15
1049
1050       Convert a mirror LV to a linear LV, freeing  physical  extents  from  a
1051       specific PV.
1052       lvconvert --type linear vg/lvol1 /dev/sda
1053
1054       Split one image from a mirror or raid1 LV, making it a new LV.
1055       lvconvert --splitmirrors 1 --name lv_split vg/lvol1
1056
1057       Split one image from a raid1 LV, and track changes made to the raid1 LV
1058       while the split image remains detached.
1059       lvconvert --splitmirrors 1 --trackchanges vg/lvol1
1060
1061       Merge an image (that was previously  created  with  --splitmirrors  and
1062       --trackchanges) back into the original raid1 LV.
1063       lvconvert --mergemirrors vg/lvol1_rimage_1
1064
1065       Replace PV /dev/sdb1 with PV /dev/sdf1 in a raid1/4/5/6/10 LV.
1066       lvconvert --replace /dev/sdb1 vg/lvol1 /dev/sdf1
1067
1068       Replace 3 PVs /dev/sd[b-d]1 with PVs /dev/sd[f-h]1 in a raid1 LV.
1069       lvconvert --replace /dev/sdb1 --replace /dev/sdc1 --replace /dev/sdd1
1070              vg/lvol1 /dev/sd[fgh]1
1071
1072       Replace  the  maximum  of 2 PVs /dev/sd[bc]1 with PVs /dev/sd[gh]1 in a
1073       raid6 LV.
1074       lvconvert --replace /dev/sdb1 --replace /dev/sdc1 vg/lvol1 /dev/sd[gh]1
1075
1076       Convert an LV into a thin LV in the specified thin pool.  The  existing
1077       LV is used as an external read-only origin for the new thin LV.
1078       lvconvert --type thin --thinpool vg/tpool1 vg/lvol1
1079
1080       Convert  an LV into a thin LV in the specified thin pool.  The existing
1081       LV is used as an external read-only origin for the new thin LV, and  is
1082       renamed "external".
1083       lvconvert --type thin --thinpool vg/tpool1
1084              --originname external vg/lvol1
1085
1086       Convert  an  LV to a cache pool LV using another specified LV for cache
1087       pool metadata.
1088       lvconvert --type cache-pool --poolmetadata vg/poolmeta1 vg/lvol1
1089
1090       Convert an LV to a cache LV using the specified cache  pool  and  chunk
1091       size.
1092       lvconvert --type cache --cachepool vg/cpool1 -c 128 vg/lvol1
1093
1094       Detach and keep the cache pool from a cache LV.
1095       lvconvert --splitcache vg/lvol1
1096
1097       Detach and remove the cache pool from a cache LV.
1098       lvconvert --uncache vg/lvol1
1099

SEE ALSO

1101       lvm(8) lvm.conf(5) lvmconfig(8)
1102
1103       pvchange(8)  pvck(8)  pvcreate(8)  pvdisplay(8)  pvmove(8)  pvremove(8)
1104       pvresize(8) pvs(8) pvscan(8)
1105
1106       vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8)  vgcreate(8)  vgcon‐
1107       vert(8)  vgdisplay(8)  vgexport(8)  vgextend(8)  vgimport(8)  vgimport‐
1108       clone(8) vgmerge(8) vgmknodes(8)  vgreduce(8)  vgremove(8)  vgrename(8)
1109       vgs(8) vgscan(8) vgsplit(8)
1110
1111       lvcreate(8)  lvchange(8)  lvconvert(8)  lvdisplay(8)  lvextend(8) lvre‐
1112       duce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)
1113
1114       lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeacti‐
1115       vate(8) lvmdump(8)
1116
1117       dmeventd(8)  lvmpolld(8)  lvmlockd(8)  lvmlockctl(8)  cmirrord(8) lvmd‐
1118       busd(8)
1119
1120       lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)
1121
1122
1123
1124Red Hat, Inc.          LVM TOOLS 2.03.11(2) (2021-01-08)          LVCONVERT(8)
Impressum