summaryrefslogtreecommitdiff
path: root/man/lvconvert.8.in
blob: 747bb7db6dada61eeabe16352a5547129a089583 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
.TH LVCONVERT 8 "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
.SH NAME
lvconvert \(em change LV type and other utilities
.
.SH SYNOPSIS

.B lvconvert
.RI [ OPTION ]...
.IR VolumeGroup / LogicalVolume

.SH DESCRIPTION

lvconvert changes the LV type and includes various LV utilities.

To display the current LV type, run the command:

.B lvs \-o name,segtype VG/LV

To change the LV type, run the command:

.B lvconvert \-\-type
.I NewType
.B VG/LV

.SS LV types

The LV type is also called the "segment type" or "segtype".

LVs with the following types can be modified by lvconvert:
.B striped,
.B snapshot,
.B mirror,
.B raid*,
.B thin,
.B cache,
.B thin\-pool,
.B cache\-pool.

The specific operations available on each LV type are listed below.

The
.B linear
type is equivalent to the
.B striped
type when one stripe exists.
In that case, the types can sometimes be used interchangably.

In most cases, the
.B mirror
type is deprecated and the
.B raid1
type should be used.  They are both implementations of mirroring.

The
.B raid*
type refers to one of many raid levels, e.g.
.B raid1,
.B raid5.
See
.BR lvmraid (7)
for a full list.

.SS LV layers

In some cases, an LV is a single device mapper (dm) layer above physical
devices.  In other cases, hidden LVs (dm devices) are layered between the
visible LV and physical devices.  LVs in the middle layers are sometimes
called sub LVs.

Changing the LV type will often change the composition of sub LVs.

Sub LVs can be displayed with the command
.B lvs -a.

A command run on a visible LV sometimes operates on a sub LV rather than
the specified LV.  These cases are noted below.

Sometimes a sub LV must be specified directly on the command line, but
this is a non-standard form.  These cases may change in the future to
avoid the direct use of hidden LVs.

.SH COMMANDS

.SS Operations on a StripedLV with type striped or linear:

\&

.B lvconvert \-\-merge
VG/StripedLV
.br
\[bu]
Merge StripedLV into an LV when it is a previously split mirror
.br
\[bu]
See --splitmirror.
./" FIXME: use --merge-mirror

.B lvconvert \-\-type snapshot
VG/StripedLV VG/SnapshotLV
.br
\[bu]
Recombine StripedLV with SnapshotLV which was previously split.
.br
\[bu]
See --splitsnapshot.

.B lvconvert \-\-type thin
VG/StripedLV
.br
\[bu]
Convert StripedLV to type thin with an external origin.
.br
\[bu]
Also specify a thin pool to use, see \-\-thinpool.
.br
\[bu]
StripedLV becomes a read\-only external origin LV with a new name.
.br
\[bu]
See \-\-originname.

.B lvconvert \-\-type cache
VG/StripedLV
.br
\[bu]
Convert StripedLV to type cache.
.br
\[bu]
Also specify a cache pool to use, see \-\-cachepool.

.B lvconvert \-\-type thin\-pool
VG/StripedLV
.br
\[bu]
Convert StripedLV to type thin\-pool.

.B lvconvert \-\-type cache\-pool
VG/StripedLV
.br
\[bu]
Convert StripedLV to type cache\-pool.

.B lvconvert \-\-type mirror
VG/StripedLV
.br
\[bu]
Convert StripedLV to type mirror.
.br
\[bu]
Also specify the number of mirrors, see \-\-mirrors.

.B lvconvert \-\-type raid*
VG/StripedLV
.br
\[bu]
Convert StripedLV to type raid*.
.br
\[bu]
Also specify the number of mirrors, see \-\-mirrors.

.SS Operations on RaidLV with type raid*:

\&

.B lvconvert \-\-mirrors
Number
VG/RaidLV
.br
\[bu]
Change the number of images in a raid1 RaidLV.

.B lvconvert \-\-splitmirrors
Number
VG/RaidLV
.br
\[bu]
Split images from raid1 RaidLV and use them to create a new LV.
.br
\[bu]
Also specify \-\-name for new LV, or use \-\-trackchanges.

.B lvconvert \-\-merge
VG/RaidLV
.br
\[bu]
Merge RaidLV into an LV when it is a previously split mirror.
.br
\[bu]
See --splitmirror.
./" FIXME: use --merge-mirror

.B lvconvert \-\-repair
VG/RaidLV
.br
\[bu]
Replace failed PVs in RaidLV.

.B lvconvert \-\-replace
PV
.B [\-\-replace
PV
.B ...]
VG/RaidLV
.br
\[bu]
Replace specific PV(s) in a raid* LV with another PV.
.br
\[bu]
The replacement PV can be optionally specified, see below.

.B lvconvert \-\-type snapshot
VG/RaidLV
VG/SnapshotLV
.br
\[bu]
Combine RaidLV with SnapshotLV that was previously split.
.br
\[bu]
See \-\-splitsnapshot.

.B lvconvert \-\-type thin
VG/RaidLV
.br
\[bu]
Convert RaidLV to type thin with an external origin.
.br
\[bu]
Also specify a thin pool to use, see \-\-thinpool.
.br
\[bu]
RaidLV becomes a read\-only external origin LV with a new name.
.br
\[bu]
See \-\-originname.

.B lvconvert \-\-type cache
VG/RaidLV
.br
\[bu]
Convert RaidLV to type cache.
.br
\[bu]
Also specify a cache pool to use, see \-\-cachepool.

.B lvconvert \-\-type thin\-pool
VG/RaidLV
.br
\[bu]
Convert RaidLV to type thin\-pool.

.B lvconvert \-\-type cache\-pool
VG/RaidLV
.br
\[bu]
Convert RaidLV to type cache\-pool.

.B lvconvert \-\-type raid*
VG/RaidLV
.br
\[bu]
Convert RaidLV to use a different raid level.

.B lvconvert \-\-type striped
VG/RaidLV
.br
\[bu]
Convert RaidLV to type striped.

.B lvconvert \-\-type linear
VG/RaidLV
.br
\[bu]
Convert RaidLV to type linear.

.SS Operations on MirrorLV with type mirror:

\&

.B lvconvert \-\-mirrors
Number
VG/MirrorLV
.br
\[bu]
Change the number of images in MirrorLV.

.B lvconvert \-\-splitmirrors
Number
VG/MirrorLV
.br
\[bu]
Split images from MirrorLV and use them to create a new LV.
.br
\[bu]
Also specify \-\-name for new LV.

.B lvconvert \-\-mirrorlog
LogType
VG/MirrorLV
.br
\[bu]
Change the type of log used by MirrorLV.
.br
\[bu]
See --mirrorlog and --corelog for log types.

.B lvconvert \-\-repair
VG/MirrorLV
.br
\[bu]
Replace failed PVs in MirrorLV.

.B lvconvert \-\-type linear
VG/MirrorLV
.br
\[bu]
Convert MirrorLV to type linear.

.B lvconvert \-\-type raid*
VG/MirrorLV
.br
\[bu]
Convert MirrorLV to type raid*.
.br
\[bu]
See lvmraid(7) for permitted raid levels.

.SS Operations on CachePoolLV with type cache\-pool:

\&

.B lvconvert \-\-splitcache
VG/CachePoolLV
.br
\[bu]
Split the cache LV from CachePoolLV.

.SS Operations on CacheLV with type cache:

\&

.B lvconvert \-\-splitcache
VG/CacheLV
.br
\[bu]
Split and keep the cache pool from CacheLV.

.B lvconvert \-\-uncache
VG/CacheLV
.br
\[bu]
Split and remove the cache pool from CacheLV.

.B lvconvert \-\-splitmirrors
Number
VG/CacheLV
.br
\[bu]
Split images from the mirrored origin of CacheLV to create a new LV.
.br
\[bu]
Operates on mirror or raid1 sub LV.
.br
\[bu]
Also specify \-\-name for new LV, or use \-\-trackchanges.

.B lvconvert \-\-type thin\-pool
VG/CacheLV
.br
\[bu]
Convert CacheLV to type thin-pool.
.br
\[bu]
The CacheLV is used for thin pool data.


.SS Operations on ThinPoolLV with type thin\-pool:

\&

.B lvconvert \-\-splitcache
VG/ThinPoolLV
.br
\[bu]
Split and keep the cache pool from the data portion of ThinPoolLV.
.br
\[bu]
Operates on the data sub LV of the thin pool LV.
.br
\[bu]
The data sub LV of the thin pool must be a cache LV.

.B lvconvert \-\-uncache
VG/ThinPoolLV
.br
\[bu]
Split and remove the cache pool from the data portion of ThinPoolLV.
.br
\[bu]
Operates on the data sub LV of the thin pool LV.
.br
\[bu]
The data sub LV of the thin pool must be a cache LV.

.B lvconvert \-\-type cache
VG/ThinPoolLV
.br
\[bu]
Convert the data portion of ThinPoolLV to type cache.
.br
\[bu]
Operates on the data sub LV of the thin pool LV.

.B lvconvert \-\-repair
VG/ThinPoolLV
.br
\[bu]
Repair ThinPoolLV.

.SS Operations on ThinLV with type thin:

\&

.B lvconvert \-\-merge
VG/ThinLV
.br
\[bu]
Merge ThinLV into its origin LV.
.br
\[bu]
ThinLV must have been created as a snapshot of another thin LV.
./" FIXME: use --merge-snapshot

.SS Operations on SnapshotLV with type snapshot:

\&

.B lvconvert \-\-splitsnapshot
VG/SnapshotLV
.br
\[bu]
Separate COW snapshot SnapshotLV from its origin LV.

.B lvconvert \-\-merge
VG/SnapshotLV
.br
\[bu]
Merge COW snapshot SnapshotLV into its origin.
./" FIXME: use --merge-snapshot

.SH OPTIONS
.
See \fBlvm\fP(8) for common options.
.br
.
.HP
.BR \-b ,
.BR \-\-background
.br
If the operation requires polling, this option causes the command to
return before the operation is complete, and polling is done in the
background.
.
.HP
.BR \-\-cachepolicy
.IR Policy
.br
Specifies the cache policy for a cache LV.  Also see
.BR lvmcache (7).
.
.HP
.BR \-\-cachepool
.IR CachePoolLogicalVolume { Name | Path }
.br
Specifies the cache pool to use when converting an LV to a cache LV.  If
CachePoolLogicalVolume is not yet a cache pool, the command will attempt
to convert it into a cache pool prior to the cache LV conversion.
Also see
.BR lvmcache (7).
.
.HP
.BR \-\-cachesettings
.IB Key = Value
.br
Specifies tunable values for a cache LV.  (The default values should
usually be adequate.)  The special string value \fBdefault\fP switches
settings back to their default kernel values and removes them from the
list of settings stored in LVM metadata.
Also see
.BR lvmcache (7).
.
.HP
.BR \-c ,
.BR \-\-chunksize
.BR \fIChunkSize [ b | B | s | S | k | K | m | M | g | G ]
.br
Sets the chunk size for a snapshot, cache pool or thin pool.
The default unit is in kilobytes.
.sp
For snapshots, the value must be a power of 2 between 4KiB and 512KiB
and the default value is 4.
.sp
For a cache pool the value must be between 32KiB and 1GiB and
the default value is 64.
.sp
For a thin pool the value must be between 64KiB and
1GiB and the default value starts with 64 and scales
up to fit the pool metadata size within 128MiB,
if the pool metadata size is not specified.
The value must be a multiple of 64KiB.
(Early kernel support until thin target version 1.4 required the value
to be a power of 2.  Discards were not supported for non-power of 2 values
until thin target version 1.5.)
.
.HP
.BR \-\-corelog
.br
Specifies or changes the log type for a mirror LV.
It is an alias for \fB\-\-mirrorlog core\fP.
(This option does not apply to the \fBraid1\fP LV type.)
.
.HP
.BR \-\-discards
.RB { ignore | nopassdown | passdown }
.br
Specifies if discards will be processed by the thin layer in the
kernel and passed down to the Physical Volume.  This applies only
to thin pools.  The default is \fBpassdown\fP.
.
.HP
.BR \-i ,
.BR \-\-interval
.IR Seconds
.br
Report progress as a percentage at regular intervals.
.
.HP
.BR \-\-merge
.br
Merges a snapshot that was split from an origin LV using
\fB\-\-splitsnapshot\fP, back into the origin LV.

Merges a raid1 image that was split from a raid1 LV using
\fB\-\-splitsnapshot\fP and \fB\-\-trackchanges\fP, back into
the original raid1 LV.

To check if the kernel supports the snapshot merge feature, look for
"snapshot\-merge" in the output of \fBdmsetup targets\fP.

When merging a snapshot, if both the origin and snapshot LVs are not open,
the merge will start immediately.  Otherwise, the merge will start the
first time either the origin or snapshot LV are activated and both are
closed.  Merging a snapshot into an origin that cannot be closed, for
example a root filesystem, is deferred until the next time the origin
volume is activated.  When merging starts, the resulting LV will have the
origin's name, minor number and UUID.  While the merge is in progress,
reads or writes to the origin appear as being directed to the snapshot
being merged.  When the merge finishes, the merged snapshot is removed.
Multiple snapshots may be specified on the command line or a @tag may be
used to specify multiple snapshots be merged to their respective origin.
.
.HP
.BR \-\-mirrorlog
.RB { disk | core | mirrored }
.br
Specifies or changes the log type for a mirror LV.
The default is \fBdisk\fP, which is persistent and requires
a small amount of storage space, usually on a separate device
from the data being mirrored.
\fBCore\fP may be useful for short-lived mirrors.  It means the mirror is
regenerated by copying the data from the first device again every
time the device is activated - e.g. possibly after every reboot.
Using \fBmirrored\fP will create a persistent log that is itself mirrored.
(This option does not apply to the \fBraid1\fP LV type.)
.
.HP
.BR \-m ,
.BR \-\-mirrors
.IR Number
.br
Specifies the number mirror images in addition to the original LV image,
e.g. \fB\-\-mirrors 1\fP means two copies of the data, the original and
one mirror image.

This option is required when converting an LV to a \fBraid1\fP or
\fBmirror\fP LV.

This option can be used alone to change the number of mirror images in an
existing \fBraid1\fP or \fBmirror\fP LV.

The special case \fB\-\-mirrors 0\fP indicates a linear LV with no mirror
images.
.
.HP
.BR \-n ,
.BR \-\-name
.IR Name
.br
Specifies the name to use when the command is creating a new LV, e.g.
.B \-\-splitmirrors.
.
.HP
.BR \-\-noudevsync
.br
Disables udev synchronisation. The process will not wait for notification
from udev.  It will continue irrespective of any possible udev processing
in the background.  You should only use this if udev is not running or has
rules that ignore the devices LVM creates.
.
.HP
.BR \-\-originname
.IR NewExternalOriginVolumeName
.br
Specifies the name to use for the external origin LV when converting an LV
to a thin LV.  The LV being converted becomes a read\-only external origin
with this name.
.br
Without this option, the default name of "lvol<n>" will be generated where
<n> is the LVM internal number of the LV.
.br
.
.\" .HP
.\" .BR \-\-pooldatasize
.\" .IR PoolDataVolumeSize [ \fBbBsSkKmMgGtTpPeE ]
.\" .br
.\" Sets the size of pool's data logical volume.
.\" The option \fB\-\-size\fP could be still used with thin pools.
.
.HP
.BR \-\-poolmetadata
.IR PoolMetadataLogicalVolume { Name | Path }
.br
Specifies the LV to use for thin pool metadata when converting an LV to a
thin pool LV.
.br
Specifies the LV to use for cache pool metadata when converting an LV to a
cache pool LV.
.br
The size should be between 2MiB and 16GiB.
.br
(This option can also be used when a thin pool or cache pool are created
as an auxiliary operation within a different command.)
Also see
.BR lvmthin (7),
and
.BR lvmcache (7).
.
.HP
.BR \-\-poolmetadatasize
.BR \fIPoolMetadataSize [ b | B | s | S | k | K | m | M | g | G ]
.br
Specifies the size of a cache pool metadata LV or a thin pool metadata LV.
This is used if a command creates a pool metadata LV automatically as part
of the operation.  This option is not used when an existing LV is
specified as the pool metadata LV, i.e. \fB\-\-poolmetadata\fP.
The default unit is megabytes.
Also see
.BR lvmthin (7),
and
.BR lvmcache (7).
.
.HP
.BR \-\-poolmetadataspare
.RB { y | n }
.br
Specifies if a spare pool metadata LV should be created.
A spare pool metadata LV will be used for pool repair.
Only one spare pool metadata LV is maintained within a VG, with the size
of the largest existing pool metadata LV.
The default is \fBy\fPes.
.
.HP
.BR \-r ,
.BR \-\-readahead
.RB { \fIReadAheadSectors | auto | none }
.br
Specifies the read ahead sector count of a thin pool metadata LV.
The default value is \fBauto\fP which allows the kernel to choose
a suitable value automatically.
\fBNone\fP is equivalent to specifying zero.
.
.HP
.BR \-R ,
.BR \-\-regionsize
.IR MirrorLogRegionSize
.br
A mirror LV is divided into regions of this size (in MB), and the mirror
log uses this granularity to track which regions are in sync.
(This option does not apply to the \fBraid1\fP LV type.)
.
.HP
.BR \-\-repair
.br
Replaces failed PVs in a raid1 or mirror LV with other PVs available in
the VG.  By default, the original number of mirror images will be restored
if possible.  Specify \fB\-y\fP on the command line to skip the prompts.
Use \fB\-f\fP if you do not want any replacement.  You may use
\fB\-\-use\-policies\fP to use the device replacement policy specified in
\fBlvm.conf\fP(5), see \fBactivation/mirror_log_fault_policy\fP or
\fBactivation/mirror_device_fault_policy\fP.

When used with a thin pool LV, this option automates the use of the
\fBthin_repair\fP(8) tool on the thin pool.  This repairs a very limitted
number of problems.  Only inactive thin pools can be repaired.  There is
no validation of metadata between kernel and LVM.  This requires further
manual work.  After successfull repair the old unmodified metadata are
still available in "<pool>_meta<n>" LV.
.
.HP
.BR \-\-replace
.IR PhysicalVolume
.br
Remove the specified device (\fIPhysicalVolume\fP) and replace it with one
that is available in the VG, or from a specific list of PVs specified on
the command line following the LV name. This option may be repeated multiple
times depending on the RaidLV type. Maxima for raid1 are N-1 mirrors,
for raid4/5 1 stripe, for raid6 2 stripes and for raid10 it is the number
of stripes, i.e. one mirror in each mirror group. It is recommended to keep
resilience whilst replacing PVs whenever possible, i.e. only replace a maximum
of N-2 mirrors in a raid1 LV and 1 stripe in a raid6 LV at a time;
this is not possible with raid4/5/10 LVs, because any single replaced PV
will render the RaidLV non-resilient against another PV failure during replacement.
.br
(This option only applies to \fBraid*\fP LV types.)
.
.HP
.BR \-\-split
.br
Separates \fISplitableLogicalVolume\fP.
This option tries to detect the necessary split operation from its arguments.
Avoid using this option and use one of the following instead:
.B \-\-splitcache, \-\-splitmirror, \-\-splitsnapshot.
.
.HP
.BR \-\-splitcache
.br
Separates a cache pool from a cache LV, and keeps the unused cache pool
LV.  Before the separation, the cache is flushed.  Also see
.B \-\-uncache.
.
.HP
.BR \-\-splitmirrors
.IR Number
.br
Splits the specified number of images from a \fBraid1\fP or \fBmirror\fP
LV and uses them to create a new LV.

If \fB\-\-trackchanges\fP is also specified, changes to the raid1 LV are
tracked while the split LV remains detached.
.B lvconvert \-\-merge
can be used to recombine the split images with the original raid1 LV.

A name can be specified for the new LV with \fB\-\-name\fP (a name is
required without \fB\-\-trackchanges\fP).
.
.HP
.BR \-\-splitsnapshot
.br
Separates a COW snapshot from its origin LV.  The LV that is split off
contains the chunks that differ from the origin LV along with metadata
describing them.  This LV can be wiped and then destroyed with lvremove.
Also see
.B lvconvert \-\-type snapshot.
.
.HP
.BR \-\-stripes
.IR Number
.br
Specifies the number of stripes in a striped LV.  This is the number of
physical volumes (devices) across which to spread a striped LV.  Data that
appears sequential in the LV is spread (striped) across multiple devices
in units of the stripe size (see below).  This does not apply to existing
allocated space, only newly allocated space can be striped.
.
.HP
.BR \-I ,
.BR \-\-stripesize
.IR StripeSize
.br
Specifies the stripe size in kilobytes for a striped LV.  The stripe size
is the number of kilobytes written to each stripe, i.e. to one device,
before writing to the next stripe/device.  StripeSize must be a power of 2
and cannot exceed the VG physical extent (PE) size.
.
.HP
.BR \-\-type
.IR SegmentType
.br
Converts an LV from one segment type to another.  See commmands above.
.
.HP
.BR \-\-thinpool
.IR ThinPoolLogicalVolume { Name | Path }
.br
Specifies the thin pool to use when converting an LV to a thin LV.  If
ThinPoolLogicalVolume is not yet a thin pool, the command will attempt to
convert it to a thin pool prior to the thin LV conversion.
Also see
.BR lvmthin (7).
.
.HP
.BR \-\-trackchanges
.br
Can be used with \fB\-\-splitmirrors\fP on a raid1 LV.  This causes
changes to the original raid1 LV to be tracked while the split images
remain detached.  This allows the read\-only detached image(s) to be
merged efficiently back into the raid1 LV later.  Only the regions with
changed data are resynchronized during merge.  (This option only applies
to the \fBraid1\fP LV type.)
.
.HP
.BR \-\-uncache
.br
Separates a cache pool from a cache LV, and removes the unused cache pool
LV.  Before the separation, the cache is flushed.  Also see
.B \-\-splitcache.
.
.HP
.BR \-Z ,
.BR \-\-zero
.RB { y | n }
.br
For snapshots, this controls zeroing of the first 4KiB of data in the
snapshot.  If the LV is read\-only, the snapshot will not be zeroed.

For thin pools, this controls zeroing of provisioned blocks.
Provisioning of large zeroed chunks negatively impacts performance.
.

.SS Option aliases

.B \-\-type cache
can be replaced with
.B \-H
or
.B \-\-cache.

.B \-\-type thin
can be replaced with
.B \-T
or
.B \-\-thin.

.B \-\-type snapshot
can be replaced with
.B \-s
or
.B \-\-snapshot.

.SH Examples
.
Convert a linear LV to a two-way mirror LV:
.br
.B lvconvert \-\-type mirror \-\-mirrors 1 vg/lvol1

Convert a linear LV to a two-way RAID1 LV:
.br
.B lvconvert \-\-type raid1 \-\-mirrors 1 vg/lvol1

Convert a mirror LV to use an in\-memory log:
.br
.B lvconvert \-\-mirrorlog core vg/lvol1

Convert a mirror LV to use a disk log:
.br
.B lvconvert \-\-mirrorlog disk vg/lvol1

Convert a mirror or raid1 LV to a linear LV:
.br
.B lvconvert --type linear vg/lvol1

Convert a mirror LV to a raid1 LV with the same number of images:
.br
.B lvconvert \-\-type raid1 vg/lvol1

./" Split and merge a COW snapshot:
./" TODO
Convert a linear LV to a two-way mirror LV, allocating new extents from specific
PV ranges:
.br
.B lvconvert \-\-mirrors 1 vg/lvol1 /dev/sda:0\-15 /dev/sdb:0\-15

Convert a mirror LV to a linear LV, freeing physical extents from a specific PV:
.br
.B lvconvert \-\-type linear vg/lvol1 /dev/sda

Split one image from a mirror or raid1 LV, making it a new LV:
.br
.B lvconvert \-\-splitmirrors 1 \-\-name lv_split vg/lvol1

Split one image from a raid1 LV, and track changes made to the raid1 LV
while the split image remains detached:
.br
.B lvconvert \-\-splitmirrors 1 \-\-trackchanges vg/lvol1

Merge an image (that was previously created with \-\-splitmirrors and
\-\-trackchanges) back into the original raid1 LV:
.br
.B lvconvert \-\-merge vg/lvol1_rimage_1
./" FIXME: use merge-mirror

Replace PV /dev/sdb1 with PV /dev/sdf1 in a raid1/4/5/6/10 LV:
.br
.B lvconvert \-\-replace /dev/sdb1 vg/lvol1 /dev/sdf1

Replace 3 PVs /dev/sd[b-d]1 with PVs /dev/sd[f-h]1 in a raid1 LV:
.br
.B lvconvert \-\-replace /dev/sdb1 \-\-replace /dev/sdc1 \-\-replace /dev/sdd1
.RS
.B vg/lvol1 /dev/sd[fgh]1
.RE

Replace the maximum of 2 PVs /dev/sd[bc]1 with PVs /dev/sd[gh]1 in a raid6 LV:
.br
.B lvconvert \-\-replace /dev/sdb1 \-\-replace /dev/sdc1 vg/lvol1 /dev/sd[gh]1

Convert an LV into a thin LV in the specified thin pool.  The existing LV
is used as an external read\-only origin for the new thin LV.
.br
.B lvconvert \-\-type thin \-\-thinpool vg/tpool1 vg/lvol1

Convert an LV into a thin LV in the specified thin pool.  The existing LV
is used as an external read\-only origin for the new thin LV, and is
renamed "external":
.br
.B lvconvert \-\-type thin \-\-thinpool vg/tpool1
.RS
.B \-\-originname external vg/lvol1
.RE

Convert an LV to a cache pool LV using another specified LV for cache pool
metadata:
.br
.B lvconvert \-\-type cache-pool \-\-poolmetadata vg/poolmeta1 vg/lvol1

Convert an LV to a cache LV using the specified cache pool and chunk size:
.br
.B lvconvert \-\-cache \-\-cachepool vg/cpool1 \-c 128 vg/lvol1

Detach and keep the cache pool from a cache LV:
.br
.B lvconvert \-\-splitcache vg/lvol1

Detach and remove the cache pool from a cache LV:
.br
.B lvconvert \-\-uncache vg/lvol1

.SH SEE ALSO
.BR lvm (8),
.BR lvm.conf (5),
.BR lvmcache (7),
.BR lvmthin (7),
.BR lvdisplay (8),
.BR lvextend (8),
.BR lvreduce (8),
.BR lvremove (8),
.BR lvrename (8),
.BR lvscan (8),
.BR vgcreate (8),
.BR cache_dump (8),
.BR cache_repair (8),
.BR cache_restore (8),
.BR thin_dump (8),
.BR thin_repair (8),
.BR thin_restore (8)