import source from lvm2 2.02.79
[external/device-mapper.git] / man / lvconvert.8.in
1 .TH LVCONVERT 8 "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
2 .SH NAME
3 lvconvert \- convert a logical volume from linear to mirror or snapshot
4 .SH SYNOPSIS
5 .B lvconvert
6 \-m|\-\-mirrors Mirrors [\-\-mirrorlog {disk|core|mirrored}] [\-\-corelog] [\-R|\-\-regionsize MirrorLogRegionSize]
7 [\-A|\-\-alloc AllocationPolicy]
8 [\-b|\-\-background] [\-f|\-\-force] [\-i|\-\-interval Seconds]
9 [\-h|\-?|\-\-help]
10 [\-\-stripes Stripes [\-I|\-\-stripesize StripeSize]]
11 [\-\-noudevsync]
12 [\-v|\-\-verbose] [\-y|\-\-yes]
13 [\-\-version]
14 .br
15 LogicalVolume[Path] [PhysicalVolume[Path][:PE[-PE]]...]
16 .br
17
18 .br
19 .B lvconvert
20 \-\-splitmirrors Images \-\-name SplitLogicalVolumeName
21 .br
22 MirrorLogicalVolume[Path] [SplittablePhysicalVolume[Path][:PE[-PE]]...]
23 .br
24
25 .br
26 .B lvconvert
27 \-s|\-\-snapshot [\-c|\-\-chunksize ChunkSize]
28 [\-h|\-?|\-\-help]
29 [\-\-noudevsync]
30 [\-v|\-\-verbose]
31 [\-Z|\-\-zero y|n]
32 [\-\-version]
33 .br
34 OriginalLogicalVolume[Path] SnapshotLogicalVolume[Path]
35 .br
36
37 .br
38 .B lvconvert
39 \-\-merge [\-b|\-\-background] [\-i|\-\-interval Seconds]
40 [\-h|\-?|\-\-help]
41 [\-v|\-\-verbose]
42 [\-\-version]
43 SnapshotLogicalVolume[Path]...
44 .br
45
46 .br
47 .B lvconvert
48 \-\-repair
49 [\-h|\-?|\-\-help]
50 [\-v|\-\-verbose]
51 [\-\-version]
52 LogicalVolume[Path] [PhysicalVolume[Path]...]
53 .SH DESCRIPTION
54 lvconvert will change a linear logical volume to a mirror
55 logical volume or to a snapshot of linear volume and vice versa.
56 It is also used to add and remove disk logs from mirror devices.
57 .br
58 If the conversion requires allocation of physical extents (for
59 example, when converting from linear to mirror) and you specify
60 one or more PhysicalVolumes (optionally with ranges of physical
61 extents), allocation of physical extents will be restricted to
62 these physical extents.  If the conversion frees physical extents
63 (for example, when converting from a mirror to a linear, or reducing
64 mirror legs) and you specify one or more PhysicalVolumes,
65 the freed extents come first from the specified PhysicalVolumes.
66 .SH OPTIONS
67 See \fBlvm\fP for common options.
68 .br
69 Exactly one of \-\-splitmirrors, \-\-mirrors, \-\-repair, \-\-snapshot
70 or \-\-merge arguments is required.
71 .br
72 .TP
73 .I \-m, \-\-mirrors Mirrors
74 Specifies the degree of the mirror you wish to create.
75 For example, "-m 1" would convert the original logical
76 volume to a mirror volume with 2-sides; that is, a
77 linear volume plus one copy.
78 .TP
79 .I \-\-mirrorlog {disk|core|mirrored}
80 Specifies the type of log to use.
81 The default is disk, which is persistent and requires
82 a small amount of storage space, usually on a separate device
83 from the data being mirrored. 
84 Core may be useful for short-lived mirrors: It means the mirror is
85 regenerated by copying the data from the first device again every
86 time the device is activated - perhaps, for example, after every reboot.
87 Using "mirrored" will create a persistent log that is itself mirrored.
88 .TP
89 .I \-\-corelog
90 The optional argument "--corelog" is the same as specifying "--mirrorlog core".
91 .TP
92 .I \-R, \-\-regionsize MirrorLogRegionSize
93 A mirror is divided into regions of this size (in MB), and the mirror log
94 uses this granularity to track which regions are in sync.
95 .TP
96 .I \-b, \-\-background
97 Run the daemon in the background.
98 .TP
99 .I \-i, \-\-interval Seconds
100 Report progress as a percentage at regular intervals.
101 .br
102 .TP
103 .I \-\-noudevsync
104 Disable udev synchronisation. The
105 process will not wait for notification from udev.
106 It will continue irrespective of any possible udev processing
107 in the background.  You should only use this if udev is not running
108 or has rules that ignore the devices LVM2 creates.
109 .br
110
111
112 .TP
113 .I \-\-splitmirrors Images
114 The number of redundant Images of a mirror to be split off and used
115 to form a new logical volume.  A name must be supplied for the
116 newly-split-off logical volume using the \-\-name argument.
117
118 .TP
119 .I \-n Name
120 The name to apply to a logical volume which has been split off from
121 a mirror logical volume.
122 .br
123
124
125 .TP
126 .I \-s, \-\-snapshot
127 Create a snapshot from existing logical volume using another
128 existing logical volume as its origin.
129 .TP
130 .I \-c, \-\-chunksize ChunkSize
131 Power of 2 chunk size for the snapshot logical volume between 4k and 512k.
132 .TP
133 .I \-Z, \-\-zero y|n
134 Controls zeroing of the first KB of data in the snapshot.
135 If the volume is read-only the snapshot will not be zeroed.
136 .TP
137 .I \-\-merge
138 Merges a snapshot into its origin volume.  To check if your kernel
139 supports this feature, look for 'snapshot-merge' in the output
140 of 'dmsetup targets'.  If both the origin and snapshot volume are not
141 open the merge will start immediately.  Otherwise, the merge will start
142 the first time either the origin or snapshot are activated and both are closed.
143 Merging a snapshot into an origin that cannot be closed, for example a root
144 filesystem, is deferred until the next time the origin volume is activated.
145 When merging starts, the resulting logical volume will have the origin's name,
146 minor number and UUID.  While the merge is in progress, reads or writes to the
147 origin appear as they were directed to the snapshot being merged.  When the
148 merge finishes, the merged snapshot is removed.  Multiple snapshots may
149 be specified on the commandline or a @tag may be used to specify
150 multiple snapshots be merged to their respective origin.
151 .br
152
153
154 .TP
155 .I \-\-repair
156 Repair a mirror after suffering a disk failure. The mirror will be brought back
157 into a consistent state.  By default, the original number of mirrors will be
158 restored if possible.  Specify \-y on the command line to skip the prompts.
159 Use \-f if you do not want any replacement.  Additionally, you may use
160 \-\-use-policies to use the device replacement policy specified in lvm.conf,
161 viz. activation/mirror_log_fault_policy or
162 activation/mirror_device_fault_policy.
163 .br
164 .SH Examples
165 "lvconvert -m1 vg00/lvol1"
166 .br
167 converts the linear logical volume "vg00/lvol1" to
168 a two-way mirror logical volume.
169
170 "lvconvert --mirrorlog core vg00/lvol1"
171 .br
172 converts a mirror with a disk log to a
173 mirror with an in-memory log.
174
175 "lvconvert --mirrorlog disk vg00/lvol1"
176 .br
177 converts a mirror with an in-memory log
178 to a mirror with a disk log.
179
180 "lvconvert -m0 vg00/lvol1"
181 .br
182 converts a mirror logical volume to a linear logical
183 volume.
184 .br
185
186 .br
187 "lvconvert -s vg00/lvol1 vg00/lvol2"
188 .br
189 converts logical volume "vg00/lvol2" to snapshot of original volume "vg00/lvol1"
190
191 .br
192 "lvconvert -m1 vg00/lvol1 /dev/sda:0-15 /dev/sdb:0-15"
193 .br
194 converts linear logical volume "vg00/lvol1" to a two-way mirror, using physical
195 extents /dev/sda:0-15 and /dev/sdb:0-15 for allocation of new extents.
196
197 .br
198 "lvconvert -m0 vg00/lvmirror1 /dev/sda
199 .br
200 converts mirror logical volume "vg00/lvmirror1" to linear, freeing physical
201 extents from /dev/sda.
202
203 .br
204 "lvconvert --merge vg00/lvol1_snap"
205 .br
206 merges "vg00/lvol1_snap" into its origin.
207
208 .br
209 "lvconvert --merge @some_tag"
210 .br
211 If vg00/lvol1, vg00/lvol2, and vg00/lvol3 are all tagged with "some_tag"
212 each snapshot logical volume will be merged serially, e.g.: vg00/lvol1,
213 then vg00/lvol2, then vg00/lvol3.  If --background were used it would start
214 all snapshot logical volume merges in parallel.
215
216 .SH SEE ALSO
217 .BR lvm (8),
218 .BR vgcreate (8),
219 .BR lvremove (8),
220 .BR lvrename (8),
221 .BR lvextend (8),
222 .BR lvreduce (8),
223 .BR lvdisplay (8),
224 .BR lvscan (8)