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

DESCRIPTION

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

USAGE

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

OPTIONS

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

VARIABLES

749       VG
750              Volume Group name.  See lvm(8) for valid names.
751
752       LV
753              Logical  Volume  name.  See lvm(8) for valid names.  An LV posi‐
754              tional arg generally includes the VG  name  and  LV  name,  e.g.
755              VG/LV.  LV followed by _<type> indicates that an LV of the given
756              type is required. (raid represents raid<N> type)
757
758       PV
759              Physical Volume name, a device path under  /dev.   For  commands
760              managing physical extents, a PV positional arg generally accepts
761              a suffix indicating a range (or  multiple  ranges)  of  physical
762              extents  (PEs). When the first PE is omitted, it defaults to the
763              start of the device, and when the last PE is omitted it defaults
764              to  end.   Start and end range (inclusive): PV[:PE-PE]...  Start
765              and length range (counting from 0): PV[:PE+PE]...
766
767       Tag
768              Tag name.  See lvm(8) for information about tag names and  using
769              tags in place of a VG, LV or PV.
770
771       String
772              See the option description for information about the string con‐
773              tent.
774
775       Size[UNIT]
776              Size is an input number that accepts an  optional  unit.   Input
777              units are always treated as base two values, regardless of capi‐
778              talization, e.g. 'k' and 'K' both refer to  1024.   The  default
779              input unit is specified by letter, followed by |UNIT.  UNIT rep‐
780              resents other possible input units:  bBsSkKmMgGtTpPeE.   b|B  is
781              bytes,  s|S  is  sectors  of 512 bytes, k|K is kilobytes, m|M is
782              megabytes, g|G is gigabytes, t|T is terabytes, p|P is petabytes,
783              e|E  is  exabytes.  (This should not be confused with the output
784              control --units, where capital letters mean multiple of 1000.)
785

ENVIRONMENT VARIABLES

787       See lvm(8) for information about environment  variables  used  by  lvm.
788       For example, LVM_VG_NAME can generally be substituted for a required VG
789       parameter.
790

ADVANCED USAGE

792       Alternate command forms, advanced command usage,  and  listing  of  all
793       valid syntax for completeness.
794
795       Convert LV to type mirror (also see type raid1),
796       (also see lvconvert --mirrors).
797
798       lvconvert --type mirror LV
799           [ -m|--mirrors [+|-]Number ]
800           [ -R|--regionsize Size[m|UNIT] ]
801           [ -i|--interval Number ]
802           [    --mirrorlog core|disk ]
803           [ COMMON_OPTIONS ]
804           [ PV ... ]
805       -
806
807       Change the region size of an LV.
808
809       lvconvert -R|--regionsize Size[m|UNIT] LV_raid
810           [ COMMON_OPTIONS ]
811       -
812
813       Change the type of mirror log used by a mirror LV.
814
815       lvconvert --mirrorlog core|disk LV_mirror
816           [ COMMON_OPTIONS ]
817           [ PV ... ]
818       -
819
820       Convert LV to a thin LV, using the original LV as an external origin
821       (infers --type thin).
822
823       lvconvert -T|--thin --thinpool LV LV_linear_striped_thin_cache_raid
824           [ -r|--readahead auto|none|Number ]
825           [ -c|--chunksize Size[k|UNIT] ]
826           [ -Z|--zero y|n ]
827           [    --type thin ]
828           [    --originname LV_new ]
829           [    --poolmetadata LV ]
830           [    --poolmetadatasize Size[m|UNIT] ]
831           [    --poolmetadataspare y|n ]
832           [    --metadataprofile String ]
833           [ COMMON_OPTIONS ]
834       -
835
836       Convert LV to type cache (infers --type cache).
837
838       lvconvert -H|--cache --cachepool LV LV_linear_striped_thinpool_raid
839           [ -Z|--zero y|n ]
840           [ -r|--readahead auto|none|Number ]
841           [ -c|--chunksize Size[k|UNIT] ]
842           [    --type cache ]
843           [    --cachemetadataformat auto|1|2 ]
844           [    --cachemode writethrough|writeback|passthrough ]
845           [    --cachepolicy String ]
846           [    --cachesettings String ]
847           [    --poolmetadata LV ]
848           [    --poolmetadatasize Size[m|UNIT] ]
849           [    --poolmetadataspare y|n ]
850           [    --metadataprofile String ]
851           [ COMMON_OPTIONS ]
852       -
853
854       Convert LV to type vdopool.
855
856       lvconvert --vdopool LV_linear_striped_cache_raid
857           [ -n|--name LV_new ]
858           [ -V|--virtualsize Size[m|UNIT] ]
859           [    --type vdo-pool ]
860           [    --compression y|n ]
861           [    --deduplication y|n ]
862           [ COMMON_OPTIONS ]
863       -
864
865       Separate and delete the cache pool from a cache LV.
866
867       lvconvert --uncache LV_thinpool_cache
868           [ COMMON_OPTIONS ]
869       -
870
871       Swap metadata LV in a thin pool or cache pool (for repair only).
872
873       lvconvert --swapmetadata --poolmetadata LV LV_thinpool_cachepool
874           [ -c|--chunksize Size[k|UNIT] ]
875           [ COMMON_OPTIONS ]
876       -
877
878       Merge LV that was split from a mirror (variant, use --mergemirrors).
879       Merge thin LV into its origin LV (variant, use --mergethin).
880       Merge COW snapshot LV into its origin (variant, use --mergesnapshot).
881
882       lvconvert --merge VG|LV_linear_striped_snapshot_thin_raid|Tag ...
883           [ -i|--interval Number ]
884           [ COMMON_OPTIONS ]
885       -
886
887       Separate a COW snapshot from its origin LV.
888
889       lvconvert --splitsnapshot LV_snapshot
890           [ COMMON_OPTIONS ]
891       -
892
893       Combine a former COW snapshot (second arg) with a former
894       origin LV (first arg) to reverse a splitsnapshot command.
895
896       lvconvert -s|--snapshot LV LV_linear_striped
897           [ -c|--chunksize Size[k|UNIT] ]
898           [ -Z|--zero y|n ]
899           [    --type snapshot ]
900           [ COMMON_OPTIONS ]
901       -
902
903       Poll LV to continue conversion (also see --startpoll)
904       or waits till conversion/mirror syncing is finished
905
906       lvconvert LV_mirror_raid
907           [ COMMON_OPTIONS ]
908       -
909
910

NOTES

912       This previous command syntax would perform two different operations:
913       lvconvert --thinpool LV1 --poolmetadata LV2
914       If  LV1  was  not  a thin pool, the command would convert LV1 to a thin
915       pool, optionally using a specified LV for metadata.  But,  if  LV1  was
916       already  a  thin  pool,  the command would swap the current metadata LV
917       with LV2 (for repair purposes.)
918
919       In the same way, this previous command syntax would perform two differ‐
920       ent operations:
921       lvconvert --cachepool LV1 --poolmetadata LV2
922       If  LV1  was not a cache pool, the command would convert LV1 to a cache
923       pool, optionally using a specified LV for metadata.  But,  if  LV1  was
924       already  a  cache  pool, the command would swap the current metadata LV
925       with LV2 (for repair purposes.)
926

EXAMPLES

928       Convert a linear LV to a two-way mirror LV.
929       lvconvert --type mirror --mirrors 1 vg/lvol1
930
931       Convert a linear LV to a two-way RAID1 LV.
932       lvconvert --type raid1 --mirrors 1 vg/lvol1
933
934       Convert a mirror LV to use an in-memory log.
935       lvconvert --mirrorlog core vg/lvol1
936
937       Convert a mirror LV to use a disk log.
938       lvconvert --mirrorlog disk vg/lvol1
939
940       Convert a mirror or raid1 LV to a linear LV.
941       lvconvert --type linear vg/lvol1
942
943       Convert a mirror LV to a raid1 LV with the same number of images.
944       lvconvert --type raid1 vg/lvol1
945
946       Convert a linear LV to a two-way mirror LV, allocating new extents from
947       specific PV ranges.
948       lvconvert --mirrors 1 vg/lvol1 /dev/sda:0-15 /dev/sdb:0-15
949
950       Convert  a  mirror  LV  to a linear LV, freeing physical extents from a
951       specific PV.
952       lvconvert --type linear vg/lvol1 /dev/sda
953
954       Split one image from a mirror or raid1 LV, making it a new LV.
955       lvconvert --splitmirrors 1 --name lv_split vg/lvol1
956
957       Split one image from a raid1 LV, and track changes made to the raid1 LV
958       while the split image remains detached.
959       lvconvert --splitmirrors 1 --trackchanges vg/lvol1
960
961       Merge  an  image  (that  was previously created with --splitmirrors and
962       --trackchanges) back into the original raid1 LV.
963       lvconvert --mergemirrors vg/lvol1_rimage_1
964
965       Replace PV /dev/sdb1 with PV /dev/sdf1 in a raid1/4/5/6/10 LV.
966       lvconvert --replace /dev/sdb1 vg/lvol1 /dev/sdf1
967
968       Replace 3 PVs /dev/sd[b-d]1 with PVs /dev/sd[f-h]1 in a raid1 LV.
969       lvconvert --replace /dev/sdb1 --replace /dev/sdc1 --replace /dev/sdd1
970              vg/lvol1 /dev/sd[fgh]1
971
972       Replace the maximum of 2 PVs /dev/sd[bc]1 with PVs  /dev/sd[gh]1  in  a
973       raid6 LV.
974       lvconvert --replace /dev/sdb1 --replace /dev/sdc1 vg/lvol1 /dev/sd[gh]1
975
976       Convert  an LV into a thin LV in the specified thin pool.  The existing
977       LV is used as an external read-only origin for the new thin LV.
978       lvconvert --type thin --thinpool vg/tpool1 vg/lvol1
979
980       Convert an LV into a thin LV in the specified thin pool.  The  existing
981       LV  is used as an external read-only origin for the new thin LV, and is
982       renamed "external".
983       lvconvert --type thin --thinpool vg/tpool1
984              --originname external vg/lvol1
985
986       Convert an LV to a cache pool LV using another specified LV  for  cache
987       pool metadata.
988       lvconvert --type cache-pool --poolmetadata vg/poolmeta1 vg/lvol1
989
990       Convert  an  LV  to a cache LV using the specified cache pool and chunk
991       size.
992       lvconvert --type cache --cachepool vg/cpool1 -c 128 vg/lvol1
993
994       Detach and keep the cache pool from a cache LV.
995       lvconvert --splitcache vg/lvol1
996
997       Detach and remove the cache pool from a cache LV.
998       lvconvert --uncache vg/lvol1
999

SEE ALSO

1001       lvm(8) lvm.conf(5) lvmconfig(8)
1002
1003       pvchange(8)  pvck(8)  pvcreate(8)  pvdisplay(8)  pvmove(8)  pvremove(8)
1004       pvresize(8) pvs(8) pvscan(8)
1005
1006       vgcfgbackup(8)  vgcfgrestore(8)  vgchange(8) vgck(8) vgcreate(8) vgcon‐
1007       vert(8)  vgdisplay(8)  vgexport(8)  vgextend(8)  vgimport(8)  vgimport‐
1008       clone(8)  vgmerge(8)  vgmknodes(8)  vgreduce(8) vgremove(8) vgrename(8)
1009       vgs(8) vgscan(8) vgsplit(8)
1010
1011       lvcreate(8) lvchange(8)  lvconvert(8)  lvdisplay(8)  lvextend(8)  lvre‐
1012       duce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)
1013
1014       lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeacti‐
1015       vate(8) lvmdump(8)
1016
1017       dmeventd(8) lvmpolld(8)  lvmlockd(8)  lvmlockctl(8)  cmirrord(8)  lvmd‐
1018       busd(8)
1019
1020       lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)
1021
1022
1023
1024Red Hat, Inc.       LVM TOOLS 2.03.02(2)-RHEL8 (2019-01-04)       LVCONVERT(8)
Impressum