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
94       between 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
104       exists.  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           [    --cachesize Size[m|UNIT] ]
306           [    --cachesettings String ]
307           [ COMMON_OPTIONS ]
308       -
309
310       Convert LV to type thin-pool.
311
312       lvconvert --type thin-pool LV_linear_striped_cache_raid
313           [ -I|--stripesize Size[k|UNIT] ]
314           [ -r|--readahead auto|none|Number ]
315           [ -c|--chunksize Size[k|UNIT] ]
316           [ -Z|--zero y|n ]
317           [    --stripes Number ]
318           [    --discards passdown|nopassdown|ignore ]
319           [    --poolmetadata LV ]
320           [    --poolmetadatasize Size[m|UNIT] ]
321           [    --poolmetadataspare y|n ]
322           [    --metadataprofile String ]
323           [ COMMON_OPTIONS ]
324           [ PV ... ]
325       -
326
327       Convert LV to type cache-pool.
328
329       lvconvert --type cache-pool LV_linear_striped_raid
330           [ -Z|--zero y|n ]
331           [ -r|--readahead auto|none|Number ]
332           [ -c|--chunksize Size[k|UNIT] ]
333           [    --cachemetadataformat auto|1|2 ]
334           [    --cachemode writethrough|writeback|passthrough ]
335           [    --cachepolicy String ]
336           [    --cachesettings String ]
337           [    --poolmetadata LV ]
338           [    --poolmetadatasize Size[m|UNIT] ]
339           [    --poolmetadataspare y|n ]
340           [    --metadataprofile String ]
341           [ COMMON_OPTIONS ]
342           [ PV ... ]
343       -
344
345       Convert LV to type vdopool.
346
347       lvconvert --type vdo-pool LV_linear_striped_cache_raid
348           [ -n|--name LV_new ]
349           [ -V|--virtualsize Size[m|UNIT] ]
350           [    --compression y|n ]
351           [    --deduplication y|n ]
352           [ COMMON_OPTIONS ]
353       -
354
355       Detach a cache from an LV.
356
357       lvconvert --splitcache LV_thinpool_cache_cachepool_vdopool_writecache
358           [ COMMON_OPTIONS ]
359       -
360
361       Merge thin LV into its origin LV.
362
363       lvconvert --mergethin LV_thin ...
364           [ COMMON_OPTIONS ]
365       -
366
367       Merge COW snapshot LV into its origin.
368
369       lvconvert --mergesnapshot LV_snapshot ...
370           [ -i|--interval Number ]
371           [ COMMON_OPTIONS ]
372       -
373
374       Combine a former COW snapshot (second arg) with a former
375       origin LV (first arg) to reverse a splitsnapshot command.
376
377       lvconvert --type snapshot LV LV_linear_striped
378           [ -s|--snapshot ]
379           [ -c|--chunksize Size[k|UNIT] ]
380           [ -Z|--zero y|n ]
381           [ COMMON_OPTIONS ]
382       -
383
384       Replace failed PVs in a raid or mirror LV.
385       Repair a thin pool.
386       Repair a cache pool.
387
388       lvconvert --repair LV_thinpool_cache_cachepool_mirror_raid
389           [ -i|--interval Number ]
390           [    --usepolicies ]
391           [    --poolmetadataspare y|n ]
392           [ COMMON_OPTIONS ]
393           [ PV ... ]
394       -
395
396       Replace specific PV(s) in a raid LV with another PV.
397
398       lvconvert --replace PV LV_raid
399           [ COMMON_OPTIONS ]
400           [ PV ... ]
401       -
402
403       Poll LV to continue conversion.
404
405       lvconvert --startpoll LV_mirror_raid
406           [ COMMON_OPTIONS ]
407       -
408
409       Add or remove data integrity checksums to raid images.
410
411       lvconvert --raidintegrity y|n LV_raid
412           [    --raidintegritymode String ]
413           [    --raidintegrityblocksize Number ]
414           [ COMMON_OPTIONS ]
415           [ PV ... ]
416       -
417
418       Common options for command:
419           [ -b|--background ]
420           [ -f|--force ]
421           [    --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
422           ]
423           [    --noudevsync ]
424
425       Common options for lvm:
426           [ -d|--debug ]
427           [ -h|--help ]
428           [ -q|--quiet ]
429           [ -t|--test ]
430           [ -v|--verbose ]
431           [ -y|--yes ]
432           [    --commandprofile String ]
433           [    --config String ]
434           [    --driverloaded y|n ]
435           [    --lockopt String ]
436           [    --longhelp ]
437           [    --nolocking ]
438           [    --profile String ]
439           [    --version ]
440

OPTIONS

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

NOTES

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

EXAMPLES

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

SEE ALSO

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