1PVMOVE(8) System Manager's Manual PVMOVE(8)
2
3
4
6 pvmove — move physical extents
7
9 pvmove [--abort] [--alloc AllocationPolicy] [--atomic] [-b|--back‐
10 ground] [--commandprofile ProfileName] [-d|--debug] [-h|--help]
11 [-i|--interval Seconds] [--noudevsync] [-v|--verbose] [-n|--name Logi‐
12 calVolume] [SourcePhysicalVolume[:PE[-PE]...] [DestinationPhysicalVol‐
13 ume[:PE[-PE]...]...]]
14
16 pvmove allows you to move the allocated physical extents (PEs) on Sour‐
17 cePhysicalVolume to one or more other physical volumes (PVs). You can
18 optionally specify a source LogicalVolume in which case only extents
19 used by that LV will be moved to free (or specified) extents on Desti‐
20 nationPhysicalVolume(s). If no DestinationPhysicalVolume is specified,
21 the normal allocation rules for the Volume Group are used.
22
23 If pvmove gets interrupted for any reason (e.g. the machine crashes)
24 then run pvmove again without any PhysicalVolume arguments to restart
25 any moves that were in progress from the last checkpoint. Alterna‐
26 tively use pvmove --abort at any time to abort. The resulting location
27 of logical volumes after an abort is issued depends on whether the
28 --atomic option was used when starting the pvmove process.
29
30 You can run more than one pvmove at once provided they are moving data
31 off different SourcePhysicalVolumes, but additional pvmoves will ignore
32 any Logical Volumes already in the process of being changed, so some
33 data might not get moved.
34
35 pvmove works as follows:
36
37 1. A temporary 'pvmove' Logical Volume is created to store details of
38 all the data movements required.
39
40 2. Every Logical Volume in the Volume Group is searched for contiguous
41 data that need moving according to the command line arguments. For
42 each piece of data found, a new segment is added to the end of the
43 pvmove LV. This segment takes the form of a temporary mirror to copy
44 the data from the original location to a newly-allocated location. The
45 original LV is updated to use the new temporary mirror segment in the
46 pvmove LV instead of accessing the data directly.
47
48 3. The Volume Group metadata is updated on disk.
49
50 4. The first segment of the pvmove Logical Volume is activated and
51 starts to mirror the first part of the data. Only one segment is mir‐
52 rored at once as this is usually more efficient.
53
54 5. A daemon repeatedly checks progress at the specified time interval.
55 When it detects that the first temporary mirror is in-sync, it breaks
56 that mirror so that only the new location for that data gets used and
57 writes a checkpoint into the Volume Group metadata on disk. Then it
58 activates the mirror for the next segment of the pvmove LV.
59
60 6. When there are no more segments left to be mirrored, the temporary
61 Logical Volume is removed and the Volume Group metadata is updated so
62 that the Logical Volumes reflect the new data locations.
63
64 Note that this new process cannot support the original LVM1 type of on-
65 disk metadata. Metadata can be converted using vgconvert(8).
66
67 If the --atomic option is used, a slightly different approach is used
68 for the move. Again, a temporary 'pvmove' logical volume is created to
69 store the details of all the data movements required. This temporary
70 LV contains all the segments of the various LVs that need to be moved.
71 However this time, an identical logical volume is allocated that con‐
72 tains the same number of segments and a mirror is created to copy the
73 contents from the first temporary LV to the second. When a complete
74 copy is accomplished, the temporary logical volumes are removed, leav‐
75 ing behind the segments on the destination physical volume. If an
76 abort is issued during the move, all logical volumes being moved will
77 remain on the source physical volume.
78
79
81 See lvm(8) for common options.
82
83 --abort
84 Abort any moves in progress. If the --atomic option was used to
85 start the pvmove, all logical volumes will remain on the source
86 physical volume. Otherwise, those segments that have completed
87 the move will stay on the destination physical volume, while
88 those that have not will remain on the source physical volume.
89
90 --atomic
91 Make the entire operation atomic. That is, ensure that all
92 affected logical volumes are moved to the destination physical
93 volume together; unless the move has been aborted. If the move
94 has been aborted, all logical volumes will remain on the source
95 physical volume.
96
97 --noudevsync
98 Disable udev synchronisation. The process will not wait for
99 notification from udev. It will continue irrespective of any
100 possible udev processing in the background. You should only use
101 this if udev is not running or has rules that ignore the devices
102 LVM2 creates.
103
104 -b, --background
105 Run the daemon in the background.
106
107 -i, --interval Seconds
108 Report progress as a percentage at regular intervals.
109
110 -n, --name LogicalVolume
111 Move only the extents belonging to LogicalVolume from Source‐
112 PhysicalVolume instead of all allocated extents to the destina‐
113 tion physical volume(s).
114
115
117 To move all Physical Extents that are used by simple Logical Volumes on
118 /dev/sdb1 to free Physical Extents elsewhere in the Volume Group use:
119
120 pvmove /dev/sdb1
121
122 Additionally, a specific destination device /dev/sdc1 can be specified
123 like this:
124
125 pvmove /dev/sdb1 /dev/sdc1
126
127 To perform the action only on extents belonging to the single Logical
128 Volume lvol1 do this:
129
130 pvmove -n lvol1 /dev/sdb1 /dev/sdc1
131
132 Rather than moving the contents of the entire device, it is possible to
133 move a range of Physical Extents - for example numbers 1000 to 1999
134 inclusive on /dev/sdb1 - like this:
135
136 pvmove /dev/sdb1:1000-1999
137
138 A range can also be specified as start+length, so
139
140 pvmove /dev/sdb1:1000+1000
141
142 also refers to 1000 Physical Extents starting from Physical Extent num‐
143 ber 1000. (Counting starts from 0, so this refers to the 1001st to the
144 2000th inclusive.)
145
146 To move a range of Physical Extents to a specific location (which must
147 have sufficient free extents) use the form:
148
149 pvmove /dev/sdb1:1000-1999 /dev/sdc1
150
151 or
152
153 pvmove /dev/sdb1:1000-1999 /dev/sdc1:0-999
154
155 If the source and destination are on the same disk, the anywhere allo‐
156 cation policy would be needed, like this:
157
158 pvmove --alloc anywhere /dev/sdb1:1000-1999 /dev/sdb1:0-999
159
160 The part of a specific Logical Volume present within in a range of
161 Physical Extents can also be picked out and moved, like this:
162
163 pvmove -n lvol1 /dev/sdb1:1000-1999 /dev/sdc1
164
166 lvm(8), vgconvert(8) pvs(8)
167
168
169
170Sistina Software UKLVM TOOLS 2.02.143(2)-RHEL6 (2016-12-13) PVMOVE(8)