summaryrefslogtreecommitdiff
path: root/man/lvconvert.8.in
blob: 0becc8a89d253f3682dd54c540c3021cf2f539ac (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
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
.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

OPTIONS:
.br
.BR \-b ,
.BR \-\-background
.br
.BR \-\-cachepolicy
.IR Policy
.br
.BR \-\-cachepool
.IR CachePoolLogicalVolume { Name | Path }
.br
.BR \-\-cachesettings
.IB Key = Value
.br
.BR \-c ,
.BR \-\-chunksize
.BR \fIChunkSize [ b | B | s | S | k | K | m | M | g | G ]
.br
.BR \-\-corelog
.br
.BR \-\-discards
.RB { ignore | nopassdown | passdown }
.br
.BR \-i ,
.BR \-\-interval
.IR Seconds
.br
.BR \-\-merge
.br
.BR \-\-mirrorlog
.RB { disk | core | mirrored }
.br
.BR \-m ,
.BR \-\-mirrors
.IR Number
.br
.BR \-n ,
.BR \-\-name
.IR Name
.br
.BR \-\-noudevsync
.br
.BR \-\-originname
.IR NewExternalOriginVolumeName
.br
.BR \-\-poolmetadata
.IR PoolMetadataLogicalVolume { Name | Path }
.br
.BR \-\-poolmetadatasize
.BR \fIPoolMetadataSize [ b | B | s | S | k | K | m | M | g | G ]
.br
.BR \-\-poolmetadataspare
.RB { y | n }
.br
.BR \-r ,
.BR \-\-readahead
.RB { \fIReadAheadSectors | auto | none }
.br
.BR \-R ,
.BR \-\-regionsize
.IR MirrorLogRegionSize
.br
.BR \-\-repair
.br
.BR \-\-replace
.IR PhysicalVolume
.br
.BR \-\-splitcache
.br
.BR \-\-splitmirrors
.IR Number
.br
.BR \-\-splitsnapshot
.br
.BR \-\-stripes
.IR Number
.br
.BR \-I ,
.BR \-\-stripesize
.IR StripeSize
.br
.B \-\-type striped
.br
.B \-\-type snapshot
|
.B \-\-snapshot
|
.B \-s
.br
.B \-\-type mirror
.br
.B \-\-type raid*
.br
.B \-\-type thin
|
.B \-\-thin
|
.B \-T
.br
.B \-\-type cache
|
.B \-\-cache
|
.B \-H
.br
.B \-\-type thin\-pool
.br
.B \-\-type cache\-pool
.br
.BR \-\-thinpool
.IR ThinPoolLogicalVolume { Name | Path }
.br
.BR \-\-trackchanges
.br
.BR \-\-uncache
.br
.BR \-Z ,
.BR \-\-zero
.RB { y | n }
.br

Common options:
.br
.BR \-A ,
.BR \-\-alloc
.IR AllocationPolicy
.br
.BR \-f ,
.BR \-\-force
.br
.BR \-\-commandprofile
.IR ProfileName
.br
.BR \-h ,
.BR \-? ,
.BR \-\-help
.br
.BR \-v ,
.BR \-\-verbose
.br
.BR \-y ,
.BR \-\-yes
.br
.BR \-\-version




.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
.IR VG / LV

To change the LV type, run the command:

.B lvconvert \-\-type
.I NewType
.IR 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.

.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
./" FIXME: use --merge-mirror
.br
\[bu]
Merge StripedLV into an LV when it is a previously split mirror.
.br
\[bu]
Options \-\-background, \-\-interval.
.br
\[bu]
See corresponding operation --splitmirrors.

.B lvconvert \-\-type snapshot
VG/StripedLV VG/SnapshotLV
.br
\[bu]
Recombine StripedLV with SnapshotLV which was previously split.
.br
\[bu]
Options \-\-chunksize, \-\-zero.
.br
\[bu]
See corresponding operation --splitsnapshot.

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

.B lvconvert \-\-type cache
VG/StripedLV
.br
\[bu]
Convert StripedLV to type cache.
.br
\[bu]
Requires \-\-cachepool to specify the cache pool to use.
.br
\[bu]
Options \-\-cachepolicy, \-\-cachesettings.

.B lvconvert \-\-type thin\-pool
VG/StripedLV
.br
\[bu]
Convert StripedLV to type thin\-pool.
.br
\[bu]
The StripedLV is used for thin pool data.
.br
\[bu]
Options \-\-chunksize, \-\-discards, \-\-poolmetadata{size,spare},
.br
  \-\-readahead, \-\-zero.

.B lvconvert \-\-type cache\-pool
VG/StripedLV
.br
\[bu]
Convert StripedLV to type cache\-pool.
.br
\[bu]
Options \-\-chunksize, \-\-poolmetadata{size,spare}.

.B lvconvert \-\-type mirror
VG/StripedLV
.br
\[bu]
Convert StripedLV to type mirror.
.br
\[bu]
Requires \-\-mirrors to specify the number of mirrors to use.
.br
\[bu]
Options \-\-mirrorlog, \-\-regionsize.

.B lvconvert \-\-type raid*
VG/StripedLV
.br
\[bu]
Convert StripedLV to type raid*.
.br
\[bu]
Required options depend on the raid level.

.SS Operations on RaidLV with type raid*:

\&

.B lvconvert \-\-mirrors
Number
VG/RaidLV
.br
\[bu]
Change the number of images in 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]
Requires \-\-name for the new LV, or the use of \-\-trackchanges.

.B lvconvert \-\-merge
VG/RaidLV
./" FIXME: use --merge-mirror
.br
\[bu]
Merge RaidLV into an LV when it is a previously split mirror.
.br
\[bu]
Options \-\-background, \-\-interval.
.br
\[bu]
See corresponding operation --splitmirrors.

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

.B lvconvert \-\-replace
PV
VG/RaidLV
.br
\[bu]
Replace specific PV(s) in a raid* LV with another PV.
.br
\[bu]
The new PV(s) to use can be optionally specified after the LV.
.br
\[bu]
Repeat to replace multiple: \-\-replace PV1 \-\-replace PV2 ...

.B lvconvert \-\-type snapshot
VG/RaidLV
VG/SnapshotLV
.br
\[bu]
Combine RaidLV with SnapshotLV that was previously split.
.br
\[bu]
Options \-\-chunksize, \-\-zero.
.br
\[bu]
See corresponding operation \-\-splitsnapshot.

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

.B lvconvert \-\-type cache
VG/RaidLV
.br
\[bu]
Convert RaidLV to type cache.
.br
\[bu]
Requires \-\-cachepool to specify the cache pool to use.
.br
\[bu]
Options \-\-cachepolicy, \-\-cachesettings.

.B lvconvert \-\-type thin\-pool
VG/RaidLV
.br
\[bu]
Convert RaidLV to type thin\-pool.
.br
\[bu]
The RaidLV is used for thin pool data.
.br
\[bu]
Options \-\-chunksize, \-\-discards, \-\-poolmetadata{size,spare},
.br
  \-\-readahead, \-\-zero.

.B lvconvert \-\-type cache\-pool
VG/RaidLV
.br
\[bu]
Convert RaidLV to type cache\-pool.
.br
\[bu]
Options \-\-chunksize, \-\-poolmetadata{size,spare}.

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

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

.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]
Requires \-\-name for the new LV.

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

.B lvconvert \-\-repair
VG/MirrorLV
.br
\[bu]
Options \-\-background, \-\-interval.
.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]
Required options depend on the raid level.

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

\&

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

.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]
Requires \-\-name for the new LV, or the use of \-\-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.
.br
\[bu]
Options \-\-chunksize, \-\-discards, \-\-poolmetadata{size,spare},
.br
  \-\-readahead, \-\-zero.


.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]
Requires \-\-cachepool to specify the cache pool to use.
.br
\[bu]
Operates on the data sub LV of the thin pool LV.
.br
\[bu]
Options \-\-cachepolicy, \-\-cachesettings.

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

.SS Operations on ThinLV with type thin:

\&

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

.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
./" FIXME: use --merge-snapshot
.br
\[bu]
Merge COW snapshot SnapshotLV into its origin.
.br
\[bu]
Options \-\-background, \-\-interval.

.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.
Also see
.BR lvmthin (7).
.
.HP
.BR \-H ,
.BR \-\-cache
.br
Alias for
.B \-\-type cache.
See COMMANDS description for
.br
.B lvconvert \-\-type cache.
.
.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.

The current maximum is 9 providing 10 raid1 images.

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 has been used historically to
indicate 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.
Also see
.BR lvmthin (7).
.
.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.
.
.HP
.BR \-s ,
.BR \-\-snapshot
.br
Alias for
.B \-\-type snapshot.
See COMMANDS description for
.br
.B lvconvert \-\-type snapshot.
.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, \-\-splitmirrors, \-\-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.  See similar option
.B \-\-uncache.
Also see
.BR lvmcache (7).
.
.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.
See corresponding operation
.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) that a striped LV is spread across.  Data that
appears sequential in the LV is spread across multiple devices in units of
the stripe size (see \fB\-\-stripesize\fP).  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 COMMANDS section for a description of converting between each type.
.
.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 \-T ,
.BR \-\-thin
.br
Alias for
.B \-\-type thin.
See COMMANDS description for
.br
.B lvconvert \-\-type thin.
.
.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.  See similar option
.B \-\-splitcache.
Also see
.BR lvmcache (7).
.
.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.
Also see
.BR lvmthin (7).
.

.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 \-\-type 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)