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           --devices PV
31           --devicesfile String
32           --discards passdown|nopassdown|ignore
33           --driverloaded y|n
34           --errorwhenfull y|n
35        -f|--force
36        -h|--help
37        -i|--interval Number
38           --journal String
39           --lockopt String
40           --longhelp
41           --merge
42           --mergemirrors
43           --mergesnapshot
44           --mergethin
45           --metadataprofile String
46           --mirrorlog core|disk
47        -m|--mirrors [+|-]Number
48        -n|--name String
49           --nohints
50           --nolocking
51           --noudevsync
52           --originname LV
53           --poolmetadata LV
54           --poolmetadatasize Size[m|UNIT]
55           --poolmetadataspare y|n
56           --profile String
57        -q|--quiet
58           --raidintegrity y|n
59           --raidintegrityblocksize Number
60           --raidintegritymode String
61        -r|--readahead auto|none|Number
62        -R|--regionsize Size[m|UNIT]
63           --repair
64           --replace PV
65        -s|--snapshot
66           --splitcache
67           --splitmirrors Number
68           --splitsnapshot
69           --startpoll
70           --stripes Number
71        -I|--stripesize Size[k|UNIT]
72           --swapmetadata
73        -t|--test
74        -T|--thin
75           --thinpool LV
76           --trackchanges
77           --type linear|striped|snapshot|raid|mirror|thin|thin-pool|vdo|
78       vdo-pool|cache|cache-pool|writecache
79           --uncache
80           --usepolicies
81           --vdopool LV
82           --vdosettings String
83        -v|--verbose
84           --version
85        -V|--virtualsize Size[m|UNIT]
86        -y|--yes
87        -Z|--zero y|n
88

DESCRIPTION

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

USAGE

152       Convert LV to linear.
153
154       lvconvert --type linear LV
155           [ COMMON_OPTIONS ]
156           [ PV ... ]
157
158
159
160       Convert LV to striped.
161
162       lvconvert --type striped LV
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
172       Convert LV to type mirror (also see type raid1),
173
174       lvconvert --type mirror LV
175           [ -m|--mirrors [+|-]Number ]
176           [ -I|--stripesize Size[k|UNIT] ]
177           [ -R|--regionsize Size[m|UNIT] ]
178           [ -i|--interval Number ]
179           [    --stripes Number ]
180           [    --mirrorlog core|disk ]
181           [ COMMON_OPTIONS ]
182           [ PV ... ]
183
184
185
186       Convert LV to raid or change raid layout
187       (a specific raid level must be used, e.g. raid1).
188
189       lvconvert --type raid LV
190           [ -m|--mirrors [+|-]Number ]
191           [ -I|--stripesize Size[k|UNIT] ]
192           [ -R|--regionsize Size[m|UNIT] ]
193           [ -i|--interval Number ]
194           [    --stripes Number ]
195           [ COMMON_OPTIONS ]
196           [ PV ... ]
197
198
199
200       Convert LV to raid1 or mirror, or change number of mirror images.
201
202       lvconvert -m|--mirrors [+|-]Number LV
203           [ -R|--regionsize Size[m|UNIT] ]
204           [ -i|--interval Number ]
205           [    --mirrorlog core|disk ]
206           [ COMMON_OPTIONS ]
207           [ PV ... ]
208
209
210
211       Convert raid LV to change number of stripe images.
212
213       lvconvert --stripes Number LV1
214           [ -i|--interval Number ]
215           [ -R|--regionsize Size[m|UNIT] ]
216           [ -I|--stripesize Size[k|UNIT] ]
217           [ COMMON_OPTIONS ]
218           [ PV ... ]
219
220           LV1 types: raid
221
222
223
224       Convert raid LV to change the stripe size.
225
226       lvconvert -I|--stripesize Size[k|UNIT] LV1
227           [ -i|--interval Number ]
228           [ -R|--regionsize Size[m|UNIT] ]
229           [ COMMON_OPTIONS ]
230
231           LV1 types: raid
232
233
234
235       Split images from a raid1 or mirror LV and use them to create a new LV.
236
237       lvconvert --splitmirrors Number -n|--name LV_new LV1
238           [ COMMON_OPTIONS ]
239           [ PV ... ]
240
241           LV1 types: cache mirror raid1
242
243
244
245       Split  images  from  a  raid1  LV and track changes to origin for later
246       merge.
247
248       lvconvert --splitmirrors Number --trackchanges LV1
249           [ COMMON_OPTIONS ]
250           [ PV ... ]
251
252           LV1 types: cache raid1
253
254
255
256       Merge LV images that were split from a raid1 LV.
257
258       lvconvert --mergemirrors VG|LV1|Tag ...
259           [ COMMON_OPTIONS ]
260
261           LV1 types: linear raid
262
263
264
265       Convert LV to a thin LV, using the original LV as an external origin.
266
267       lvconvert --type thin --thinpool LV LV1
268           [ -T|--thin ]
269           [ -r|--readahead auto|none|Number ]
270           [ -c|--chunksize Size[k|UNIT] ]
271           [ -Z|--zero y|n ]
272           [    --originname LV_new ]
273           [    --poolmetadata LV ]
274           [    --poolmetadatasize Size[m|UNIT] ]
275           [    --poolmetadataspare y|n ]
276           [    --metadataprofile String ]
277           [ COMMON_OPTIONS ]
278
279           LV1 types: linear striped thin cache raid error zero
280
281
282
283       Attach a cache pool to an LV, converts the LV to type cache.
284
285       lvconvert --type cache --cachepool LV LV1
286           [ -H|--cache ]
287           [ -Z|--zero y|n ]
288           [ -r|--readahead auto|none|Number ]
289           [ -c|--chunksize Size[k|UNIT] ]
290           [    --cachemetadataformat auto|1|2 ]
291           [    --cachemode writethrough|writeback|passthrough ]
292           [    --cachepolicy String ]
293           [    --cachesettings String ]
294           [    --poolmetadata LV ]
295           [    --poolmetadatasize Size[m|UNIT] ]
296           [    --poolmetadataspare y|n ]
297           [    --metadataprofile String ]
298           [ COMMON_OPTIONS ]
299
300           LV1 types: linear striped thinpool vdo vdopool vdopooldata raid
301
302
303
304       Attach a writecache to an LV, converts the LV to type writecache.
305
306       lvconvert --type writecache --cachevol LV LV1
307           [    --cachesettings String ]
308           [ COMMON_OPTIONS ]
309
310           LV1 types: linear striped thinpool raid
311
312
313
314       Attach a cache to an LV, converts the LV to type cache.
315
316       lvconvert --type cache --cachevol LV LV1
317           [ -H|--cache ]
318           [ -Z|--zero y|n ]
319           [ -c|--chunksize Size[k|UNIT] ]
320           [    --cachemetadataformat auto|1|2 ]
321           [    --cachemode writethrough|writeback|passthrough ]
322           [    --cachepolicy String ]
323           [    --cachesettings String ]
324           [    --poolmetadatasize Size[m|UNIT] ]
325           [ COMMON_OPTIONS ]
326
327           LV1 types: linear striped thinpool raid
328
329
330
331       Add a writecache to an LV, using a specified cache device.
332
333       lvconvert --type writecache --cachedevice PV LV1
334           [    --cachesize Size[m|UNIT] ]
335           [    --cachesettings String ]
336           [ COMMON_OPTIONS ]
337
338           LV1 types: linear striped thinpool raid
339
340
341
342       Add a cache to an LV, using a specified cache device.
343
344       lvconvert --type cache --cachedevice PV LV1
345           [ -c|--chunksize Size[k|UNIT] ]
346           [    --cachesize Size[m|UNIT] ]
347           [    --cachesettings String ]
348           [ COMMON_OPTIONS ]
349
350           LV1 types: linear striped thinpool raid
351
352
353
354       Convert LV to type thin-pool.
355
356       lvconvert --type thin-pool LV1
357           [ -I|--stripesize Size[k|UNIT] ]
358           [ -r|--readahead auto|none|Number ]
359           [ -c|--chunksize Size[k|UNIT] ]
360           [ -Z|--zero y|n ]
361           [    --stripes Number ]
362           [    --discards passdown|nopassdown|ignore ]
363           [    --errorwhenfull y|n ]
364           [    --poolmetadata LV ]
365           [    --poolmetadatasize Size[m|UNIT] ]
366           [    --poolmetadataspare y|n ]
367           [    --metadataprofile String ]
368           [ COMMON_OPTIONS ]
369           [ PV ... ]
370
371           LV1 types: linear striped cache raid error zero writecache
372
373
374
375       Convert LV to type cache-pool.
376
377       lvconvert --type cache-pool LV1
378           [ -Z|--zero y|n ]
379           [ -r|--readahead auto|none|Number ]
380           [ -c|--chunksize Size[k|UNIT] ]
381           [    --cachemetadataformat auto|1|2 ]
382           [    --cachemode writethrough|writeback|passthrough ]
383           [    --cachepolicy String ]
384           [    --cachesettings String ]
385           [    --poolmetadata LV ]
386           [    --poolmetadatasize Size[m|UNIT] ]
387           [    --poolmetadataspare y|n ]
388           [    --metadataprofile String ]
389           [ COMMON_OPTIONS ]
390           [ PV ... ]
391
392           LV1 types: linear striped raid
393
394
395
396       Convert LV to type vdopool.
397
398       lvconvert --type vdo-pool LV1
399           [ -n|--name LV_new ]
400           [ -V|--virtualsize Size[m|UNIT] ]
401           [ -r|--readahead auto|none|Number ]
402           [ -Z|--zero y|n ]
403           [    --metadataprofile String ]
404           [    --compression y|n ]
405           [    --deduplication y|n ]
406           [    --vdosettings String ]
407           [ COMMON_OPTIONS ]
408
409           LV1 types: linear striped cache raid
410
411
412
413       Detach a cache from an LV.
414
415       lvconvert --splitcache LV1
416           [    --cachesettings String ]
417           [ COMMON_OPTIONS ]
418
419           LV1 types: thinpool cache cachepool vdopool writecache
420
421
422
423       Merge thin LV into its origin LV.
424
425       lvconvert --mergethin LV1 ...
426           [ COMMON_OPTIONS ]
427
428           LV1 types: thin
429
430
431
432       Merge COW snapshot LV into its origin.
433
434       lvconvert --mergesnapshot LV1 ...
435           [ -i|--interval Number ]
436           [ COMMON_OPTIONS ]
437
438           LV1 types: snapshot
439
440
441
442       Combine a former COW snapshot (second arg) with a former
443       origin LV (first arg) to reverse a splitsnapshot command.
444
445       lvconvert --type snapshot LV LV1
446           [ -s|--snapshot ]
447           [ -c|--chunksize Size[k|UNIT] ]
448           [ -Z|--zero y|n ]
449           [ COMMON_OPTIONS ]
450
451           LV1 types: linear striped
452
453
454
455       Replace failed PVs in a raid or mirror LV.
456       Repair a thin pool.
457       Repair a cache pool.
458
459       lvconvert --repair LV1
460           [ -i|--interval Number ]
461           [    --usepolicies ]
462           [    --poolmetadataspare y|n ]
463           [ COMMON_OPTIONS ]
464           [ PV ... ]
465
466           LV1 types: thinpool cache cachepool mirror raid
467
468
469
470       Replace specific PV(s) in a raid LV with another PV.
471
472       lvconvert --replace PV LV1
473           [ COMMON_OPTIONS ]
474           [ PV ... ]
475
476           LV1 types: raid
477
478
479
480       Poll LV to continue conversion.
481
482       lvconvert --startpoll LV1
483           [ COMMON_OPTIONS ]
484
485           LV1 types: mirror raid
486
487
488
489       Add or remove data integrity checksums to raid images.
490
491       lvconvert --raidintegrity y|n LV1
492           [    --raidintegritymode String ]
493           [    --raidintegrityblocksize Number ]
494           [ COMMON_OPTIONS ]
495           [ PV ... ]
496
497           LV1 types: raid
498
499
500
501       Common options for command:
502           [ -b|--background ]
503           [ -f|--force ]
504           [    --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
505           ]
506           [    --noudevsync ]
507
508       Common options for lvm:
509           [ -d|--debug ]
510           [ -h|--help ]
511           [ -q|--quiet ]
512           [ -t|--test ]
513           [ -v|--verbose ]
514           [ -y|--yes ]
515           [    --commandprofile String ]
516           [    --config String ]
517           [    --devices PV ]
518           [    --devicesfile String ]
519           [    --driverloaded y|n ]
520           [    --journal String ]
521           [    --lockopt String ]
522           [    --longhelp ]
523           [    --nohints ]
524           [    --nolocking ]
525           [    --profile String ]
526           [    --version ]
527

OPTIONS

529       --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
530              Determines  the  allocation policy when a command needs to allo‐
531              cate Physical Extents (PEs) from the VG. Each VG and LV  has  an
532              allocation  policy  which can be changed with vgchange/lvchange,
533              or overridden on the command line.  normal applies common  sense
534              rules  such as not placing parallel stripes on the same PV.  in‐
535              herit applies the VG policy to an LV.  contiguous  requires  new
536              PEs be placed adjacent to existing PEs.  cling places new PEs on
537              the same PV as existing PEs in the same stripe of  the  LV.   If
538              there  are sufficient PEs for an allocation, but normal does not
539              use them, anywhere will use them even if it reduces performance,
540              e.g. by placing two stripes on the same PV.  Optional positional
541              PV args on the command line can also be used to limit which  PVs
542              the command will use for allocation.  See lvm(8) for more infor‐
543              mation about allocation.
544
545       -b|--background
546              If the operation requires polling, this option causes  the  com‐
547              mand  to return before the operation is complete, and polling is
548              done in the background.
549
550       -H|--cache
551              Specifies the command is handling a cache LV or cache pool.  See
552              --type  cache  and  --type cache-pool.  See lvmcache(7) for more
553              information about LVM caching.
554
555       --cachedevice PV
556              The name of a device to use for a cache.
557
558       --cachemetadataformat auto|1|2
559              Specifies the cache metadata format used by cache target.
560
561       --cachemode writethrough|writeback|passthrough
562              Specifies when writes to a cache LV should  be  considered  com‐
563              plete.   writeback  considers  a write complete as soon as it is
564              stored in the cache pool.  writethough considers  a  write  com‐
565              plete only when it has been stored in both the cache pool and on
566              the origin LV.  While writethrough may be slower for writes,  it
567              is more resilient if something should happen to a device associ‐
568              ated with the cache pool LV. With  passthrough,  all  reads  are
569              served  from  the  origin  LV (all reads miss the cache) and all
570              writes are forwarded to the origin LV; additionally, write  hits
571              cause cache block invalidates. See lvmcache(7) for more informa‐
572              tion.
573
574       --cachepolicy String
575              Specifies the cache policy for a cache LV.  See lvmcache(7)  for
576              more information.
577
578       --cachepool LV
579              The name of a cache pool.
580
581       --cachesettings String
582              Specifies  tunable  kernel options for dm-cache or dm-writecache
583              LVs.  Use the form 'option=value' or 'option1=value option2=val‐
584              ue', or repeat --cachesettings for each option being set.  These
585              settings override the default kernel behaviors which are usually
586              adequate. To remove cachesettings and revert to the default ker‐
587              nel behaviors, use --cachesettings 'default' for dm-cache or  an
588              empty  string  --cachesettings  ''  for dm-writecache.  See lvm‐
589              cache(7) for more information.
590
591       --cachesize Size[m|UNIT]
592              The size of cache to use.
593
594       --cachevol LV
595              The name of a cache volume.
596
597       -c|--chunksize Size[k|UNIT]
598              The size of chunks in a snapshot, cache pool or thin pool.   For
599              snapshots,  the  value  must  be  a power of 2 between 4 KiB and
600              512 KiB and the default value is 4.  For a cache pool the  value
601              must  be  between  32 KiB and 1 GiB and the default value is 64.
602              For a thin pool the value must be between 64 KiB and  1 GiB  and
603              the  default  value starts with 64 and scales up to fit the pool
604              metadata size within 128 MiB, if the pool metadata size  is  not
605              specified.   The  value  must  be  a  multiple  of  64 KiB.  See
606              lvmthin(7) and lvmcache(7) for more information.
607
608       --commandprofile String
609              The command profile  to  use  for  command  configuration.   See
610              lvm.conf(5) for more information about profiles.
611
612       --compression y|n
613              Controls  whether compression is enabled or disable for VDO vol‐
614              ume.  See lvmvdo(7) for more information about VDO usage.
615
616       --config String
617              Config settings for the command. These override lvm.conf(5) set‐
618              tings.   The  String arg uses the same format as lvm.conf(5), or
619              may use section/field syntax.  See lvm.conf(5) for more informa‐
620              tion about config.
621
622       -d|--debug ...
623              Set debug level. Repeat from 1 to 6 times to increase the detail
624              of messages sent to the log file and/or syslog (if configured).
625
626       --deduplication y|n
627              Controls whether deduplication is enabled  or  disable  for  VDO
628              volume.  See lvmvdo(7) for more information about VDO usage.
629
630       --devices PV
631              Restricts  the  devices  that  are visible and accessible to the
632              command.  Devices not listed will appear to be missing. This op‐
633              tion  can  be repeated, or accepts a comma separated list of de‐
634              vices. This overrides the devices file.
635
636       --devicesfile String
637              A file listing devices that LVM should use.  The file must exist
638              in  /etc/lvm/devices/ and is managed with the lvmdevices(8) com‐
639              mand.  This overrides the  lvm.conf(5)  devices/devicesfile  and
640              devices/use_devicesfile settings.
641
642       --discards passdown|nopassdown|ignore
643              Specifies  how  the  device-mapper thin pool layer in the kernel
644              should handle discards.  ignore causes the thin pool  to  ignore
645              discards.   nopassdown  causes the thin pool to process discards
646              itself to allow reuse of unneeded  extents  in  the  thin  pool.
647              passdown  causes  the thin pool to process discards itself (like
648              nopassdown) and pass the discards to the underlying device.  See
649              lvmthin(7) for more information.
650
651       --driverloaded y|n
652              If set to no, the command will not attempt to use device-mapper.
653              For testing and debugging.
654
655       --errorwhenfull y|n
656              Specifies thin pool behavior when data space is exhausted.  When
657              yes,  device-mapper will immediately return an error when a thin
658              pool is full and an I/O request requires space.   When  no,  de‐
659              vice-mapper  will  queue these I/O requests for a period of time
660              to allow the thin pool to be extended.  Errors are  returned  if
661              no space is available after the timeout.  (Also see dm-thin-pool
662              kernel module option no_space_timeout.)  See lvmthin(7) for more
663              information.
664
665       -f|--force ...
666              Override  various  checks,  confirmations  and protections.  Use
667              with extreme caution.
668
669       -h|--help
670              Display help text.
671
672       -i|--interval Number
673              Report progress at regular intervals.
674
675       --journal String
676              Record information in the systemd journal.  This information  is
677              in  addition  to information enabled by the lvm.conf log/journal
678              setting.  command: record information about the  command.   out‐
679              put: record the default command output.  debug: record full com‐
680              mand debugging.
681
682       --lockopt String
683              Used to pass options for special cases to  lvmlockd.   See  lvm‐
684              lockd(8) for more information.
685
686       --longhelp
687              Display long help text.
688
689       --merge
690              An  alias  for  --mergethin, --mergemirrors, or --mergesnapshot,
691              depending on the type of LV.
692
693       --mergemirrors
694              Merge LV images that were split from a raid1 LV.   See  --split‐
695              mirrors with --trackchanges.
696
697       --mergesnapshot
698              Merge COW snapshot LV into its origin.  When merging a snapshot,
699              if both the origin and snapshot LVs are not open, the merge will
700              start  immediately.  Otherwise,  the  merge will start the first
701              time either the origin or snapshot LV are activated and both are
702              closed. Merging a snapshot into an origin that cannot be closed,
703              for example a root filesystem, is deferred until the  next  time
704              the origin volume is activated. When merging starts, the result‐
705              ing LV will have the origin's name, minor number and UUID. While
706              the  merge  is in progress, reads or writes to the origin appear
707              as being directed to the snapshot being merged. When  the  merge
708              finishes,  the  merged  snapshot is removed.  Multiple snapshots
709              may be specified on the command line or a @tag may  be  used  to
710              specify multiple snapshots be merged to their respective origin.
711
712       --mergethin
713              Merge  thin LV into its origin LV.  The origin thin LV takes the
714              content of the thin snapshot, and the thin snapshot  LV  is  re‐
715              moved.  See lvmthin(7) for more information.
716
717       --metadataprofile String
718              The  metadata  profile  to  use  for command configuration.  See
719              lvm.conf(5) for more information about profiles.
720
721       --mirrorlog core|disk
722              Specifies the type of mirror log for LVs with the "mirror"  type
723              (does  not apply to the "raid1" type.)  disk is a persistent log
724              and requires a small amount of storage space, usually on a sepa‐
725              rate  device  from the data being mirrored.  core is not persis‐
726              tent; the log is kept only in memory.  In this case, the  mirror
727              must  be  synchronized (by copying LV data from the first device
728              to others) each time the LV is  activated,  e.g.  after  reboot.
729              mirrored is a persistent log that is itself mirrored, but should
730              be avoided. Instead, use the raid1 type for log redundancy.
731
732       -m|--mirrors [+|-]Number
733              Specifies the number of mirror images in addition to the  origi‐
734              nal LV image, e.g. --mirrors 1 means there are two images of the
735              data, the original and one mirror image.  Optional positional PV
736              args  on  the  command  line  can specify the devices the images
737              should be placed on.  There are two  mirroring  implementations:
738              "raid1"  and "mirror".  These are the names of the corresponding
739              LV types, or "segment types".  Use the --type option to  specify
740              which  to  use  (raid1  is  default,  and  mirror is legacy) Use
741              lvm.conf(5) global/mirror_segtype_default and global/raid10_seg‐
742              type_default  to configure the default types.  The plus prefix +
743              can be used, in which case the number is added  to  the  current
744              number  of  images,  or the minus prefix - can be used, in which
745              case the number is subtracted from the current number of images.
746              See lvmraid(7) for more information.
747
748       -n|--name String
749              Specifies  the  name  of  a new LV.  When unspecified, a default
750              name of "lvol#" is generated, where # is a number  generated  by
751              LVM.
752
753       --nohints
754              Do  not  use the hints file to locate devices for PVs. A command
755              may read more devices to find PVs when hints are not  used.  The
756              command will still perform standard hint file invalidation where
757              appropriate.
758
759       --nolocking
760              Disable locking. Use with caution, concurrent commands may  pro‐
761              duce incorrect results.
762
763       --noudevsync
764              Disables udev synchronisation. The process will not wait for no‐
765              tification from udev. It will continue irrespective of any  pos‐
766              sible  udev  processing in the background. Only use this if udev
767              is not running or has rules that ignore the devices LVM creates.
768
769       --originname LV
770              Specifies the name to use for the external origin LV  when  con‐
771              verting  an  LV  to  a thin LV. The LV being converted becomes a
772              read-only external origin with this name.
773
774       --poolmetadata LV
775              The name of a an LV to use for storing pool metadata.
776
777       --poolmetadatasize Size[m|UNIT]
778              Specifies the size of the new pool metadata LV.
779
780       --poolmetadataspare y|n
781              Enable or disable the automatic creation  and  management  of  a
782              spare  pool  metadata  LV  in the VG. A spare metadata LV is re‐
783              served space that can be used when repairing a pool.
784
785       --profile String
786              An alias for --commandprofile or --metadataprofile, depending on
787              the command.
788
789       -q|--quiet ...
790              Suppress  output  and log messages. Overrides --debug and --ver‐
791              bose.  Repeat once to also  suppress  any  prompts  with  answer
792              'no'.
793
794       --raidintegrity y|n
795              Enable or disable data integrity checksums for raid images.
796
797       --raidintegrityblocksize Number
798              The  block size to use for dm-integrity on raid images.  The in‐
799              tegrity block size should usually match the device logical block
800              size,  or  the  file system block size.  It may be less than the
801              file system block size, but not less  than  the  device  logical
802              block size.  Possible values: 512, 1024, 2048, 4096.
803
804       --raidintegritymode String
805              Use  a  journal (default) or bitmap for keeping integrity check‐
806              sums consistent in case of a crash. The bitmap areas are  recal‐
807              culated after a crash, so corruption in those areas would not be
808              detected. A journal does not have  this  problem.   The  journal
809              mode  doubles writes to storage, but can improve performance for
810              scattered writes packed into a  single  journal  write.   bitmap
811              mode  can in theory achieve full write throughput of the device,
812              but would not benefit from the potential scattered  write  opti‐
813              mization.
814
815       -r|--readahead auto|none|Number
816              Sets  read  ahead  sector  count  of an LV.  auto is the default
817              which allows the kernel to choose a suitable value  automatical‐
818              ly.  none is equivalent to zero.
819
820       -R|--regionsize Size[m|UNIT]
821              Size of each raid or mirror synchronization region.  lvm.conf(5)
822              activation/raid_region_size can be used to configure a default.
823
824       --repair
825              Replace failed PVs in a raid or mirror LV, or run a repair util‐
826              ity  on  a thin pool. See lvmraid(7) and lvmthin(7) for more in‐
827              formation.
828
829       --replace PV
830              Replace a specific PV in a raid LV with another PV.  The new  PV
831              to  use  can be optionally specified after the LV.  Multiple PVs
832              can be replaced by repeating this option.   See  lvmraid(7)  for
833              more information.
834
835       -s|--snapshot
836              Combine  a former COW snapshot LV with a former origin LV to re‐
837              verse a previous --splitsnapshot command.
838
839       --splitcache
840              Separates a cache pool from a cache LV,  and  keeps  the  unused
841              cache pool LV.  Before the separation, the cache is flushed. Al‐
842              so see --uncache.
843
844       --splitmirrors Number
845              Splits the specified number of images from a raid1 or mirror  LV
846              and  uses  them  to  create  a new LV. If --trackchanges is also
847              specified, changes to the raid1 LV are tracked while  the  split
848              LV  remains  detached.   If --name is specified, then the images
849              are permanently split from the original LV and changes  are  not
850              tracked.
851
852       --splitsnapshot
853              Separates  a  COW  snapshot  from  its origin LV. The LV that is
854              split off contains the chunks that differ  from  the  origin  LV
855              along  with  metadata  describing them. This LV can be wiped and
856              then destroyed with lvremove.
857
858       --startpoll
859              Start polling an LV to continue processing a conversion.
860
861       --stripes Number
862              Specifies the number of stripes in a striped  LV.  This  is  the
863              number of PVs (devices) that a striped LV is spread across. Data
864              that appears sequential in the LV is spread across multiple  de‐
865              vices  in units of the stripe size (see --stripesize). This does
866              not apply to existing  allocated  space,  only  newly  allocated
867              space can be striped.
868
869       -I|--stripesize Size[k|UNIT]
870              The  amount  of data that is written to one device before moving
871              to the next in a striped LV.
872
873       --swapmetadata
874              Extracts the metadata LV from a pool and replaces it with anoth‐
875              er  specified  LV.   The extracted LV is preserved and given the
876              name of the LV that replaced it.  Use for repair only. When  the
877              metadata  LV is swapped out of the pool, it can be activated di‐
878              rectly and used with  thin  provisioning  tools:  cache_dump(8),
879              cache_repair(8), cache_restore(8), thin_dump(8), thin_repair(8),
880              thin_restore(8).
881
882       -t|--test
883              Run in test mode. Commands will not update  metadata.   This  is
884              implemented  by  disabling all metadata writing but nevertheless
885              returning success to the calling function. This may lead to  un‐
886              usual  error messages in multi-stage operations if a tool relies
887              on reading back metadata it believes has changed but hasn't.
888
889       -T|--thin
890              Specifies the command is handling a thin LV or thin  pool.   See
891              --type   thin,   --type   thin-pool,   and  --virtualsize.   See
892              lvmthin(7) for more information about LVM thin provisioning.
893
894       --thinpool LV
895              The name of a thin pool LV.
896
897       --trackchanges
898              Can be used with --splitmirrors  on  a  raid1  LV.  This  causes
899              changes  to  the original raid1 LV to be tracked while the split
900              images remain detached. This is a temporary  state  that  allows
901              the  read-only detached image to be merged efficiently back into
902              the raid1 LV later.  Only the  regions  with  changed  data  are
903              resynchronized  during  merge.   While  a  raid1  LV is tracking
904              changes, operations on it are limited to merging the split image
905              (see  --mergemirrors)  or  permanently  splitting the image (see
906              --splitmirrors with --name.
907
908       --type linear|striped|snapshot|raid|mirror|thin|thin-pool|vdo|vdo-pool|
909              cache|cache-pool|writecache
910              The LV type, also known as "segment type" or "segtype".  See us‐
911              age descriptions for the specific ways to use these types.   For
912              more information about redundancy and performance (raid<N>, mir‐
913              ror, striped, linear) see  lvmraid(7).   For  thin  provisioning
914              (thin,  thin-pool)  see  lvmthin(7).   For  performance  caching
915              (cache, cache-pool) see lvmcache(7).   For  copy-on-write  snap‐
916              shots (snapshot) see usage definitions.  For VDO (vdo) see lvmv‐
917              do(7).  Several commands omit an explicit  type  option  because
918              the  type  is  inferred  from  other  options or shortcuts (e.g.
919              --stripes,   --mirrors,   --snapshot,   --virtualsize,   --thin,
920              --cache,  --vdo).   Use  inferred types with care because it can
921              lead to unexpected results.
922
923       --uncache
924              Separates a cache pool from a cache LV, and deletes  the  unused
925              cache pool LV.  Before the separation, the cache is flushed. Al‐
926              so see --splitcache.
927
928       --usepolicies
929              Perform an operation  according  to  the  policy  configured  in
930              lvm.conf(5) or a profile.
931
932       --vdopool LV
933              The  name  of a VDO pool LV.  See lvmvdo(7) for more information
934              about VDO usage.
935
936       --vdosettings String
937              Specifies tunable VDO options for VDO LVs.  Use  the  form  'op‐
938              tion=value'   or   'option1=value   option2=value',   or  repeat
939              --vdosettings for each option being set.  These  settings  over‐
940              ride  the  default VDO behaviors.  To remove vdosettings and re‐
941              vert to the default VDO behaviors, use --vdosettings  'default'.
942              See lvmvdo(7) for more information.
943
944       -v|--verbose ...
945              Set  verbose level. Repeat from 1 to 4 times to increase the de‐
946              tail of messages sent to stdout and stderr.
947
948       --version
949              Display version information.
950
951       -V|--virtualsize Size[m|UNIT]
952              The virtual size of a new thin LV.  See lvmthin(7) for more  in‐
953              formation  about LVM thin provisioning.  Using virtual size (-V)
954              and actual size (-L) together creates a sparse LV.   lvm.conf(5)
955              global/sparse_segtype_default  determines  the  default  segment
956              type used to create a sparse LV.  Anything written to  a  sparse
957              LV  will  be  returned when reading from it.  Reading from other
958              areas of the LV will return blocks of zeros.  When using a snap‐
959              shot  to  create a sparse LV, a hidden virtual device is created
960              using the zero target, and  the  LV  has  the  suffix  _vorigin.
961              Snapshots  are less efficient than thin provisioning when creat‐
962              ing large sparse LVs (GiB).
963
964       -y|--yes
965              Do not prompt for confirmation interactively but  always  assume
966              the  answer  yes.  Use with extreme caution.  (For automatic no,
967              see -qq.)
968
969       -Z|--zero y|n
970              For snapshots, this controls zeroing of the first 4 KiB of  data
971              in  the  snapshot. If the LV is read-only, the snapshot will not
972              be zeroed.  For thin pools, this controls zeroing of provisioned
973              blocks.   Provisioning of large zeroed chunks negatively impacts
974              performance.
975

VARIABLES

977       VG     Volume Group name.  See lvm(8) for valid names.
978
979       LV     Logical Volume name.  See lvm(8) for valid names.  An  LV  posi‐
980              tional  arg  generally  includes  the  VG name and LV name, e.g.
981              VG/LV.  LV1 indicates the LV must have a  specific  type,  where
982              the  accepted  LV  types  are  listed.  (raid represents raid<N>
983              type).
984
985       PV     Physical Volume name, a device path under  /dev.   For  commands
986              managing physical extents, a PV positional arg generally accepts
987              a suffix indicating a range (or multiple ranges) of physical ex‐
988              tents  (PEs).  When  the first PE is omitted, it defaults to the
989              start of the device, and when the last PE is omitted it defaults
990              to  end.   Start and end range (inclusive): PV[:PE-PE]...  Start
991              and length range (counting from 0): PV[:PE+PE]...
992
993       Tag    Tag name.  See lvm(8) for information about tag names and  using
994              tags in place of a VG, LV or PV.
995
996       String See the option description for information about the string con‐
997              tent.
998
999       Size[UNIT]
1000              Size is an input number that accepts an  optional  unit.   Input
1001              units are always treated as base two values, regardless of capi‐
1002              talization, e.g. 'k' and 'K' both refer to  1024.   The  default
1003              input unit is specified by letter, followed by |UNIT.  UNIT rep‐
1004              resents other possible input units: b|B is bytes, s|S is sectors
1005              of  512  bytes,  k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB,
1006              p|P is PiB, e|E is EiB.  (This should not be confused  with  the
1007              output  control  --units, where capital letters mean multiple of
1008              1000.)
1009

ENVIRONMENT VARIABLES

1011       See lvm(8) for information about environment  variables  used  by  lvm.
1012       For example, LVM_VG_NAME can generally be substituted for a required VG
1013       parameter.
1014

ADVANCED USAGE

1016       Alternate command forms, advanced command usage,  and  listing  of  all
1017       valid syntax for completeness.
1018
1019       Change the region size of an LV.
1020
1021       lvconvert -R|--regionsize Size[m|UNIT] LV1
1022           [ COMMON_OPTIONS ]
1023
1024           LV1 types: raid
1025
1026
1027
1028       Change the type of mirror log used by a mirror LV.
1029
1030       lvconvert --mirrorlog core|disk LV1
1031           [ COMMON_OPTIONS ]
1032           [ PV ... ]
1033
1034           LV1 types: mirror
1035
1036
1037
1038       Convert LV to a thin LV, using the original LV as an external origin.
1039
1040       lvconvert -T|--thin --thinpool LV LV1
1041           [ --type thin ] (implied)
1042           [ -r|--readahead auto|none|Number ]
1043           [ -c|--chunksize Size[k|UNIT] ]
1044           [ -Z|--zero y|n ]
1045           [    --originname LV_new ]
1046           [    --poolmetadata LV ]
1047           [    --poolmetadatasize Size[m|UNIT] ]
1048           [    --poolmetadataspare y|n ]
1049           [    --metadataprofile String ]
1050           [ COMMON_OPTIONS ]
1051
1052           LV1 types: linear striped thin cache raid error zero
1053
1054
1055
1056       Attach a cache pool to an LV.
1057
1058       lvconvert -H|--cache --cachepool LV LV1
1059           [ --type cache ] (implied)
1060           [ -Z|--zero y|n ]
1061           [ -r|--readahead auto|none|Number ]
1062           [ -c|--chunksize Size[k|UNIT] ]
1063           [    --cachemetadataformat auto|1|2 ]
1064           [    --cachemode writethrough|writeback|passthrough ]
1065           [    --cachepolicy String ]
1066           [    --cachesettings String ]
1067           [    --poolmetadata LV ]
1068           [    --poolmetadatasize Size[m|UNIT] ]
1069           [    --poolmetadataspare y|n ]
1070           [    --metadataprofile String ]
1071           [ COMMON_OPTIONS ]
1072
1073           LV1 types: linear striped thinpool vdo vdopool vdopooldata raid
1074
1075
1076
1077       Attach a cache to an LV, converts the LV to type cache.
1078
1079       lvconvert -H|--cache --cachevol LV LV1
1080           [ -Z|--zero y|n ]
1081           [ -c|--chunksize Size[k|UNIT] ]
1082           [    --cachemetadataformat auto|1|2 ]
1083           [    --cachemode writethrough|writeback|passthrough ]
1084           [    --cachepolicy String ]
1085           [    --cachesettings String ]
1086           [    --poolmetadatasize Size[m|UNIT] ]
1087           [ COMMON_OPTIONS ]
1088
1089           LV1 types: linear striped thinpool raid
1090
1091
1092
1093       Convert LV to type vdopool.
1094
1095       lvconvert --vdopool LV
1096           [ --type vdo-pool ] (implied)
1097           [ -r|--readahead auto|none|Number ]
1098           [ -Z|--zero y|n ]
1099           [ -n|--name LV_new ]
1100           [ -V|--virtualsize Size[m|UNIT] ]
1101           [    --metadataprofile String ]
1102           [    --compression y|n ]
1103           [    --deduplication y|n ]
1104           [    --vdosettings String ]
1105           [ COMMON_OPTIONS ]
1106
1107
1108
1109       Detach and delete a cache from an LV.
1110
1111       lvconvert --uncache LV1
1112           [    --cachesettings String ]
1113           [ COMMON_OPTIONS ]
1114
1115           LV1 types: thinpool cache vdopool writecache
1116
1117
1118
1119       Swap metadata LV in a thin pool or cache pool (for repair only).
1120
1121       lvconvert --swapmetadata --poolmetadata LV LV1
1122           [ -c|--chunksize Size[k|UNIT] ]
1123           [ COMMON_OPTIONS ]
1124
1125           LV1 types: thinpool cachepool
1126
1127
1128
1129       Merge LV that was split from a mirror (variant, use --mergemirrors).
1130       Merge thin LV into its origin LV (variant, use --mergethin).
1131       Merge COW snapshot LV into its origin (variant, use --mergesnapshot).
1132
1133       lvconvert --merge VG|LV1|Tag ...
1134           [ -i|--interval Number ]
1135           [ COMMON_OPTIONS ]
1136
1137           LV1 types: linear striped snapshot thin raid
1138
1139
1140
1141       Separate a COW snapshot from its origin LV.
1142
1143       lvconvert --splitsnapshot LV1
1144           [ COMMON_OPTIONS ]
1145
1146           LV1 types: snapshot
1147
1148
1149
1150       Combine a former COW snapshot (second arg) with a former
1151       origin LV (first arg) to reverse a splitsnapshot command.
1152
1153       lvconvert -s|--snapshot LV LV1
1154           [ --type snapshot ] (implied)
1155           [ -c|--chunksize Size[k|UNIT] ]
1156           [ -Z|--zero y|n ]
1157           [ COMMON_OPTIONS ]
1158
1159           LV1 types: linear striped
1160
1161
1162
1163       Poll LV to continue conversion (also see --startpoll)
1164       or waits till conversion/mirror syncing is finished
1165
1166       lvconvert LV1
1167           [ COMMON_OPTIONS ]
1168
1169           LV1 types: mirror raid
1170
1171
1172

NOTES

1174       This previous command syntax would perform two different operations:
1175       lvconvert --thinpool LV1 --poolmetadata LV2
1176       If  LV1  was  not  a thin pool, the command would convert LV1 to a thin
1177       pool, optionally using a specified LV for metadata.  But,  if  LV1  was
1178       already  a  thin  pool,  the command would swap the current metadata LV
1179       with LV2 (for repair purposes.)
1180
1181       In the same way, this previous command syntax would perform two differ‐
1182       ent operations:
1183       lvconvert --cachepool LV1 --poolmetadata LV2
1184       If  LV1  was not a cache pool, the command would convert LV1 to a cache
1185       pool, optionally using a specified LV for metadata.  But,  if  LV1  was
1186       already  a  cache  pool, the command would swap the current metadata LV
1187       with LV2 (for repair purposes.)
1188

EXAMPLES

1190       Convert a linear LV to a two-way mirror LV.
1191       lvconvert --type mirror --mirrors 1 vg/lvol1
1192
1193       Convert a linear LV to a two-way RAID1 LV.
1194       lvconvert --type raid1 --mirrors 1 vg/lvol1
1195
1196       Convert a mirror LV to use an in-memory log.
1197       lvconvert --mirrorlog core vg/lvol1
1198
1199       Convert a mirror LV to use a disk log.
1200       lvconvert --mirrorlog disk vg/lvol1
1201
1202       Convert a mirror or raid1 LV to a linear LV.
1203       lvconvert --type linear vg/lvol1
1204
1205       Convert a mirror LV to a raid1 LV with the same number of images.
1206       lvconvert --type raid1 vg/lvol1
1207
1208       Convert a linear LV to a two-way mirror LV, allocating new extents from
1209       specific PV ranges.
1210       lvconvert --mirrors 1 vg/lvol1 /dev/sda:0-15 /dev/sdb:0-15
1211
1212       Convert  a  mirror  LV  to a linear LV, freeing physical extents from a
1213       specific PV.
1214       lvconvert --type linear vg/lvol1 /dev/sda
1215
1216       Split one image from a mirror or raid1 LV, making it a new LV.
1217       lvconvert --splitmirrors 1 --name lv_split vg/lvol1
1218
1219       Split one image from a raid1 LV, and track changes made to the raid1 LV
1220       while the split image remains detached.
1221       lvconvert --splitmirrors 1 --trackchanges vg/lvol1
1222
1223       Merge  an  image  (that  was previously created with --splitmirrors and
1224       --trackchanges) back into the original raid1 LV.
1225       lvconvert --mergemirrors vg/lvol1_rimage_1
1226
1227       Replace PV /dev/sdb1 with PV /dev/sdf1 in a raid1/4/5/6/10 LV.
1228       lvconvert --replace /dev/sdb1 vg/lvol1 /dev/sdf1
1229
1230       Replace 3 PVs /dev/sd[b-d]1 with PVs /dev/sd[f-h]1 in a raid1 LV.
1231       lvconvert --replace /dev/sdb1 --replace /dev/sdc1 --replace /dev/sdd1
1232              vg/lvol1 /dev/sd[fgh]1
1233
1234       Replace the maximum of 2 PVs /dev/sd[bc]1 with PVs  /dev/sd[gh]1  in  a
1235       raid6 LV.
1236       lvconvert --replace /dev/sdb1 --replace /dev/sdc1 vg/lvol1 /dev/sd[gh]1
1237
1238       Convert  an LV into a thin LV in the specified thin pool.  The existing
1239       LV is used as an external read-only origin for the new thin LV.
1240       lvconvert --type thin --thinpool vg/tpool1 vg/lvol1
1241
1242       Convert an LV into a thin LV in the specified thin pool.  The  existing
1243       LV  is used as an external read-only origin for the new thin LV, and is
1244       renamed "external".
1245       lvconvert --type thin --thinpool vg/tpool1
1246              --originname external vg/lvol1
1247
1248       Convert an LV to a cache pool LV using another specified LV  for  cache
1249       pool metadata.
1250       lvconvert --type cache-pool --poolmetadata vg/poolmeta1 vg/lvol1
1251
1252       Convert  an  LV  to a cache LV using the specified cache pool and chunk
1253       size.
1254       lvconvert --type cache --cachepool vg/cpool1 -c 128 vg/lvol1
1255
1256       Detach and keep the cache pool from a cache LV.
1257       lvconvert --splitcache vg/lvol1
1258
1259       Detach and remove the cache pool from a cache LV.
1260       lvconvert --uncache vg/lvol1
1261

SEE ALSO

1263       lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8),
1264
1265       pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8),
1266       pvremove(8), pvresize(8), pvs(8), pvscan(8),
1267
1268       vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8),
1269       vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8),
1270       vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8),
1271       vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8),
1272
1273       lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8),
1274       lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8),
1275
1276       lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8),
1277
1278       dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8),
1279       lvmdbusd(8), fsadm(8),
1280
1281       lvmsystemid(7), lvmreport(7), lvmraid(7), lvmthin(7), lvmcache(7)
1282
1283
1284
1285Red Hat, Inc.        LVM TOOLS 2.03.18(2)-git (2022-11-10)        LVCONVERT(8)
Impressum