Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / contrib / lvm2 / dist / 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}] [\-\-corelog] [\-R|\-\-regionsize MirrorLogRegionSize]
7 [\-A|\-\-alloc AllocationPolicy]
8 [\-b|\-\-background] [\-f|\-\-force] [\-i|\-\-interval Seconds]
9 [\-h|\-?|\-\-help]
10 [\-\-noudevsync]
11 [\-v|\-\-verbose] [\-y|\-\-yes]
12 [\-\-version]
13 .br
14 LogicalVolume[Path] [PhysicalVolume[Path][:PE[-PE]]...]
15 .br
16
17 .br
18 .B lvconvert
19 \-s|\-\-snapshot [\-c|\-\-chunksize ChunkSize]
20 [\-h|\-?|\-\-help]
21 [\-\-noudevsync]
22 [\-v|\-\-verbose]
23 [\-Z|\-\-zero y|n]
24 [\-\-version]
25 .br
26 OriginalLogicalVolume[Path] SnapshotLogicalVolume[Path]
27
28 .B lvconvert
29 \-\-repair
30 [\-h|\-?|\-\-help]
31 [\-v|\-\-verbose]
32 [\-\-version]
33 LogicalVolume[Path] [PhysicalVolume[Path]...]
34 .SH DESCRIPTION
35 lvconvert will change a linear logical volume to a mirror
36 logical volume or to a snapshot of linear volume and vice versa.
37 It is also used to add and remove disk logs from mirror devices.
38 .br
39 If the conversion requires allocation of physical extents (for
40 example, when converting from linear to mirror) and you specify
41 one or more PhysicalVolumes (optionally with ranges of physical
42 extents), allocation of physical extents will be restricted to
43 these physical extents.  If the conversion frees physical extents
44 (for example, when converting from a mirror to a linear, or reducing
45 mirror legs) and you specify one or more PhysicalVolumes,
46 the freed extents come first from the specified PhysicalVolumes.
47 .SH OPTIONS
48 See \fBlvm\fP for common options.
49 .br
50 Exactly one of \-\-mirrors, \-\-repair or \-\-snapshot arguments required.
51 .br
52 .TP
53 .I \-m, \-\-mirrors Mirrors
54 Specifies the degree of the mirror you wish to create.
55 For example, "-m 1" would convert the original logical
56 volume to a mirror volume with 2-sides; that is, a
57 linear volume plus one copy.
58 .TP
59 .I \-\-mirrorlog {disk|core}
60 Specifies the type of log to use.
61 The default is disk, which is persistent and requires
62 a small amount of storage space, usually on a separate device
63 from the data being mirrored. 
64 Core may be useful for short-lived mirrors: It means the mirror is
65 regenerated by copying the data from the first device again every
66 time the device is activated - perhaps, for example, after every reboot.
67 .TP
68 .I \-\-corelog
69 The optional argument "--corelog" is the same as specifying "--mirrorlog core".
70 .TP
71 .I \-R, \-\-regionsize MirrorLogRegionSize
72 A mirror is divided into regions of this size (in MB), and the mirror log
73 uses this granularity to track which regions are in sync.
74 .TP
75 .I \-b, \-\-background
76 Run the daemon in the background.
77 .TP
78 .I \-i, \-\-interval Seconds
79 Report progress as a percentage at regular intervals.
80 .br
81 .TP
82 .I \-\-noudevsync
83 Disable udev synchronisation. The
84 process will not wait for notification from udev.
85 It will continue irrespective of any possible udev processing
86 in the background.  You should only use this if udev is not running
87 or has rules that ignore the devices LVM2 creates.
88 .TP
89 .I \-\-repair
90 Repair a mirror after suffering a disk failure. The mirror will be brought back
91 into a consistent state.  By default, the original number of mirrors will be
92 restored if possible.  Specify \-y on the command line to skip the prompts.
93 Use \-f if you do not want any replacement.  Additionally, you may use
94 \-\-use-policies to use the device replacement policy specified in lvm.conf,
95 viz. activation/mirror_log_fault_policy or
96 activation/mirror_device_fault_policy.
97 .br
98 .TP
99 .I \-s, \-\-snapshot
100 Create a snapshot from existing logical volume using another
101 existing logical volume as its origin.
102 .TP
103 .I \-c, \-\-chunksize ChunkSize
104 Power of 2 chunk size for the snapshot logical volume between 4k and 512k.
105 .TP
106 .I \-Z, \-\-zero y|n
107 Controls zeroing of the first KB of data in the snapshot.
108 If the volume is read-only the snapshot will not be zeroed.
109 .br
110 .SH Examples
111 "lvconvert -m1 vg00/lvol1"
112 .br
113 converts the linear logical volume "vg00/lvol1" to
114 a two-way mirror logical volume.
115
116 "lvconvert --mirrorlog core vg00/lvol1"
117 .br
118 converts a mirror with a disk log to a
119 mirror with an in-memory log.
120
121 "lvconvert --mirrorlog disk vg00/lvol1"
122 .br
123 converts a mirror with an in-memory log
124 to a mirror with a disk log.
125
126 "lvconvert -m0 vg00/lvol1"
127 .br
128 converts a mirror logical volume to a linear logical
129 volume.
130 .br
131
132 .br
133 "lvconvert -s vg00/lvol1 vg00/lvol2"
134 .br
135 converts logical volume "vg00/lvol2" to snapshot of original volume "vg00/lvol1"
136
137 .br
138 "lvconvert -m1 vg00/lvol1 /dev/sda:0-15 /dev/sdb:0-15"
139 .br
140 converts linear logical volume "vg00/lvol1" to a two-way mirror, using physical
141 extents /dev/sda:0-15 and /dev/sdb:0-15 for allocation of new extents.
142
143 .br
144 "lvconvert -m0 vg00/lvmirror1 /dev/sda
145 .br
146 converts mirror logical volume "vg00/lvmirror1" to linear, freeing physical
147 extents from /dev/sda.
148
149 .SH SEE ALSO
150 .BR lvm (8),
151 .BR vgcreate (8),
152 .BR lvremove (8),
153 .BR lvrename (8),
154 .BR lvextend (8),
155 .BR lvreduce (8),
156 .BR lvdisplay (8),
157 .BR lvscan (8)