]>
Commit | Line | Data |
---|---|---|
5951ef33 | 1 | .TH PVMOVE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*- |
f32e9b2f AK |
2 | .SH NAME |
3 | pvmove \- move physical extents | |
4 | .SH SYNOPSIS | |
5 | .B pvmove | |
63bea03e AK |
6 | [\-\-abort] |
7 | [\-\-alloc AllocationPolicy] | |
82dcb097 | 8 | [\-b|\-\-background] |
c48b1005 PR |
9 | [\-d|\-\-debug] [\-h|\-\-help] [\-i|\-\-interval Seconds] |
10 | [\-\-noudevsync] [\-v|\-\-verbose] [\-n|\-\-name LogicalVolume] | |
9bd40d31 | 11 | [SourcePhysicalVolume[:PE[-PE]...] [DestinationPhysicalVolume[:PE[-PE]...]...]] |
f32e9b2f AK |
12 | .SH DESCRIPTION |
13 | .B pvmove | |
14 | allows you to move the allocated physical extents (PEs) on | |
15 | .I SourcePhysicalVolume | |
16 | to one or more other physical volumes (PVs). | |
17 | You can optionally specify a source | |
18 | .I LogicalVolume | |
19 | in which case only extents used by that LV will be moved to | |
20 | free (or specified) extents on | |
21 | .IR DestinationPhysicalVolume (s). | |
22 | If no | |
23 | .I DestinationPhysicalVolume | |
900a2676 | 24 | is specified, the normal allocation rules for the Volume Group are used. |
f32e9b2f | 25 | |
5518374b AK |
26 | If \fBpvmove\fP gets interrupted for any reason (e.g. the machine crashes) |
27 | then run \fBpvmove\fP again without any PhysicalVolume arguments to | |
05503c5e AK |
28 | restart any moves that were in progress from the last checkpoint. |
29 | Alternatively use \fBpvmove --abort\fP at any time to abort them | |
30 | at the last checkpoint. | |
31 | ||
32 | You can run more than one pvmove at once provided they are moving data | |
33 | off different SourcePhysicalVolumes, but additional pvmoves will ignore | |
900a2676 | 34 | any Logical Volumes already in the process of being changed, so some |
05503c5e AK |
35 | data might not get moved. |
36 | ||
37 | \fBpvmove\fP works as follows: | |
38 | ||
900a2676 | 39 | 1. A temporary 'pvmove' Logical Volume is created to store |
05503c5e AK |
40 | details of all the data movements required. |
41 | ||
900a2676 | 42 | 2. Every Logical Volume in the Volume Group is searched |
05503c5e AK |
43 | for contiguous data that need moving |
44 | according to the command line arguments. | |
45 | For each piece of data found, a new segment is added to the end of the | |
46 | pvmove LV. | |
47 | This segment takes the form of a temporary mirror to copy the data | |
48 | from the original location to a newly-allocated location. | |
49 | The original LV is updated to use the new temporary mirror segment | |
50 | in the pvmove LV instead of accessing the data directly. | |
51 | ||
900a2676 | 52 | 3. The Volume Group metadata is updated on disk. |
05503c5e | 53 | |
900a2676 | 54 | 4. The first segment of the pvmove Logical Volume is activated and starts |
05503c5e AK |
55 | to mirror the first part of the data. Only one segment is mirrored at once |
56 | as this is usually more efficient. | |
57 | ||
58 | 5. A daemon repeatedly checks progress at the specified time interval. | |
59 | When it detects that the first temporary mirror is in-sync, | |
60 | it breaks that mirror so that only the new location for that data gets used | |
900a2676 | 61 | and writes a checkpoint into the Volume Group metadata on disk. |
05503c5e AK |
62 | Then it activates the mirror for the next segment of the pvmove LV. |
63 | ||
64 | 6. When there are no more segments left to be mirrored, | |
900a2676 AK |
65 | the temporary Logical Volume is removed and the Volume Group metadata |
66 | is updated so that the Logical Volumes reflect the new data locations. | |
05503c5e AK |
67 | |
68 | Note that this new process cannot support the original LVM1 | |
69 | type of on-disk metadata. Metadata can be converted using \fBvgconvert\fP(8). | |
f32e9b2f | 70 | |
900a2676 AK |
71 | N.B. The moving of mirrors, snapshots and their origins is not yet supported. |
72 | ||
f32e9b2f AK |
73 | .SH OPTIONS |
74 | .TP | |
5518374b | 75 | .I \-\-abort |
05503c5e AK |
76 | Abort any moves in progress. |
77 | .TP | |
c48b1005 PR |
78 | .I \-\-noudevsync |
79 | Disable udev synchronisation. The | |
80 | process will not wait for notification from udev. | |
81 | It will continue irrespective of any possible udev processing | |
82 | in the background. You should only use this if udev is not running | |
83 | or has rules that ignore the devices LVM2 creates. | |
84 | .TP | |
d8ff86fd | 85 | .I \-b, \-\-background |
05503c5e | 86 | Run the daemon in the background. |
5518374b | 87 | .TP |
f32e9b2f AK |
88 | .I \-i, \-\-interval Seconds |
89 | Report progress as a percentage at regular intervals. | |
90 | .TP | |
91 | .I \-n, \-\-name " \fILogicalVolume\fR" | |
92 | Move only the extents belonging to | |
93 | .I LogicalVolume | |
94 | from | |
95 | .I SourcePhysicalVolume | |
96 | instead of all allocated extents to the destination physical volume(s). | |
97 | ||
98 | .SH EXAMPLES | |
900a2676 | 99 | To move all Physical Extents that are used by simple Logical Volumes on |
84d2039b | 100 | .B /dev/sdb1 |
900a2676 | 101 | to free Physical Extents elsewhere in the Volume Group use: |
f32e9b2f | 102 | .sp |
84d2039b JEB |
103 | \ pvmove /dev/sdb1 |
104 | .P | |
900a2676 AK |
105 | Any mirrors, snapshots and their origins are left unchanged. |
106 | .P | |
107 | Additionally, a specific destination device | |
108 | .B /dev/sdc1 | |
109 | can be specified like this: | |
5951ef33 | 110 | .sp |
84d2039b JEB |
111 | \ pvmove /dev/sdb1 /dev/sdc1 |
112 | .P | |
900a2676 AK |
113 | To perform the action only on extents belonging to the single Logical Volume |
114 | .B lvol1 | |
115 | do this: | |
84d2039b JEB |
116 | .sp |
117 | \ pvmove -n lvol1 /dev/sdb1 /dev/sdc1 | |
118 | .P | |
119 | Rather than moving the contents of the entire device, it is possible to | |
900a2676 AK |
120 | move a range of Physical Extents - for example numbers 1000 to 1999 inclusive on |
121 | .B /dev/sdb1 | |
122 | - like this: | |
84d2039b JEB |
123 | .sp |
124 | \ pvmove /dev/sdb1:1000-1999 | |
125 | .P | |
900a2676 AK |
126 | To move a range of Physical Extents to a specific location (which must have |
127 | sufficent free extents) use the form: | |
84d2039b JEB |
128 | .sp |
129 | \ pvmove /dev/sdb1:1000-1999 /dev/sdc1 | |
130 | .sp | |
900a2676 AK |
131 | or |
132 | .sp | |
133 | \ pvmove /dev/sdb1:1000-1999 /dev/sdc1:0-999 | |
84d2039b | 134 | .P |
900a2676 AK |
135 | If the source and destination are on the same disk, the |
136 | .B anywhere | |
137 | allocation policy would be needed, like this: | |
138 | .sp | |
139 | \ pvmove --alloc anywhere /dev/sdb1:1000-1999 /dev/sdb1:0-999 | |
140 | .P | |
141 | ||
142 | The part of a specific Logical Volume present within in a range of Physical | |
143 | Extents can also be picked out and moved, like this: | |
84d2039b JEB |
144 | .sp |
145 | \ pvmove -n lvol1 /dev/sdb1:1000-1999 /dev/sdc1 | |
f32e9b2f | 146 | .SH SEE ALSO |
5951ef33 AK |
147 | .BR lvm (8), |
148 | .BR vgconvert (8) | |
900a2676 | 149 | .BR pvs (8) |