1PVMOVE(8) System Manager's Manual PVMOVE(8)
2
3
4
6 pvmove - Move extents from one physical volume to another
7
9 pvmove position_args
10 [ option_args ]
11 [ position_args ]
12
14 pvmove moves the allocated physical extents (PEs) on a source PV to one
15 or more destination PVs. You can optionally specify a source LV in
16 which case only extents used by that LV will be moved to free (or spec‐
17 ified) extents on the destination PV. If no destination PV is speci‐
18 fied, the normal allocation rules for the VG are used.
19
20 If pvmove is interrupted for any reason (e.g. the machine crashes) then
21 run pvmove again without any PV arguments to restart any operations
22 that were in progress from the last checkpoint. Alternatively, use the
23 abort option at any time to abort the operation. The resulting location
24 of LVs after an abort depends on whether the atomic option was used.
25
26 More than one pvmove can run concurrently if they are moving data from
27 different source PVs, but additional pvmoves will ignore any LVs
28 already in the process of being changed, so some data might not get
29 moved.
30
32 Move PV extents.
33
34 pvmove PV
35 [ -A|--autobackup y|n ]
36 [ -n|--name LV ]
37 [ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
38 ]
39 [ --atomic ]
40 [ --noudevsync ]
41 [ --reportformat basic|json ]
42 [ COMMON_OPTIONS ]
43 [ PV ... ]
44
45 Continue or abort existing pvmove operations.
46
47 pvmove
48 [ COMMON_OPTIONS ]
49
50 Common options for command:
51 [ -b|--background ]
52 [ -i|--interval Number ]
53 [ --abort ]
54
55 Common options for lvm:
56 [ -d|--debug ]
57 [ -h|--help ]
58 [ -q|--quiet ]
59 [ -t|--test ]
60 [ -v|--verbose ]
61 [ -y|--yes ]
62 [ --commandprofile String ]
63 [ --config String ]
64 [ --driverloaded y|n ]
65 [ --lockopt String ]
66 [ --longhelp ]
67 [ --profile String ]
68 [ --version ]
69
71 --abort
72 Abort any pvmove operations in progress. If a pvmove was started
73 with the --atomic option, then all LVs will remain on the source
74 PV. Otherwise, segments that have been moved will remain on the
75 destination PV, while unmoved segments will remain on the source
76 PV.
77
78 --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
79 Determines the allocation policy when a command needs to allo‐
80 cate Physical Extents (PEs) from the VG. Each VG and LV has an
81 allocation policy which can be changed with vgchange/lvchange,
82 or overriden on the command line. normal applies common sense
83 rules such as not placing parallel stripes on the same PV.
84 inherit applies the VG policy to an LV. contiguous requires new
85 PEs be placed adjacent to existing PEs. cling places new PEs on
86 the same PV as existing PEs in the same stripe of the LV. If
87 there are sufficient PEs for an allocation, but normal does not
88 use them, anywhere will use them even if it reduces performance,
89 e.g. by placing two stripes on the same PV. Optional positional
90 PV args on the command line can also be used to limit which PVs
91 the command will use for allocation. See lvm(8) for more infor‐
92 mation about allocation.
93
94 --atomic
95 Makes a pvmove operation atomic, ensuring that all affected LVs
96 are moved to the destination PV, or none are if the operation is
97 aborted.
98
99 -A|--autobackup y|n
100 Specifies if metadata should be backed up automatically after a
101 change. Enabling this is strongly advised! See vgcfgbackup(8)
102 for more information.
103
104 -b|--background
105 If the operation requires polling, this option causes the com‐
106 mand to return before the operation is complete, and polling is
107 done in the background.
108
109 --commandprofile String
110 The command profile to use for command configuration. See
111 lvm.conf(5) for more information about profiles.
112
113 --config String
114 Config settings for the command. These override lvm.conf set‐
115 tings. The String arg uses the same format as lvm.conf, or may
116 use section/field syntax. See lvm.conf(5) for more information
117 about config.
118
119 -d|--debug ...
120 Set debug level. Repeat from 1 to 6 times to increase the detail
121 of messages sent to the log file and/or syslog (if configured).
122
123 --driverloaded y|n
124 If set to no, the command will not attempt to use device-mapper.
125 For testing and debugging.
126
127 -h|--help
128 Display help text.
129
130 -i|--interval Number
131 Report progress at regular intervals.
132
133 --lockopt String
134 Used to pass options for special cases to lvmlockd. See lvm‐
135 lockd(8) for more information.
136
137 --longhelp
138 Display long help text.
139
140 -n|--name String
141 Move only the extents belonging to the named LV.
142
143 --noudevsync
144 Disables udev synchronisation. The process will not wait for
145 notification from udev. It will continue irrespective of any
146 possible udev processing in the background. Only use this if
147 udev is not running or has rules that ignore the devices LVM
148 creates.
149
150 --profile String
151 An alias for --commandprofile or --metadataprofile, depending on
152 the command.
153
154 -q|--quiet ...
155 Suppress output and log messages. Overrides --debug and --ver‐
156 bose. Repeat once to also suppress any prompts with answer
157 'no'.
158
159 --reportformat basic|json
160 Overrides current output format for reports which is defined
161 globally by the report/output_format setting in lvm.conf. basic
162 is the original format with columns and rows. If there is more
163 than one report per command, each report is prefixed with the
164 report name for identification. json produces report output in
165 JSON format. See lvmreport(7) for more information.
166
167 -t|--test
168 Run in test mode. Commands will not update metadata. This is
169 implemented by disabling all metadata writing but nevertheless
170 returning success to the calling function. This may lead to
171 unusual error messages in multi-stage operations if a tool
172 relies on reading back metadata it believes has changed but
173 hasn't.
174
175 -v|--verbose ...
176 Set verbose level. Repeat from 1 to 4 times to increase the
177 detail of messages sent to stdout and stderr.
178
179 --version
180 Display version information.
181
182 -y|--yes
183 Do not prompt for confirmation interactively but always assume
184 the answer yes. Use with extreme caution. (For automatic no,
185 see -qq.)
186
188 PV
189 Physical Volume name, a device path under /dev. For commands
190 managing physical extents, a PV positional arg generally accepts
191 a suffix indicating a range (or multiple ranges) of physical
192 extents (PEs). When the first PE is omitted, it defaults to the
193 start of the device, and when the last PE is omitted it defaults
194 to end. Start and end range (inclusive): PV[:PE-PE]... Start
195 and length range (counting from 0): PV[:PE+PE]...
196
197 String
198 See the option description for information about the string con‐
199 tent.
200
201 Size[UNIT]
202 Size is an input number that accepts an optional unit. Input
203 units are always treated as base two values, regardless of capi‐
204 talization, e.g. 'k' and 'K' both refer to 1024. The default
205 input unit is specified by letter, followed by |UNIT. UNIT rep‐
206 resents other possible input units: bBsSkKmMgGtTpPeE. b|B is
207 bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is
208 megabytes, g|G is gigabytes, t|T is terabytes, p|P is petabytes,
209 e|E is exabytes. (This should not be confused with the output
210 control --units, where capital letters mean multiple of 1000.)
211
213 See lvm(8) for information about environment variables used by lvm.
214 For example, LVM_VG_NAME can generally be substituted for a required VG
215 parameter.
216
218 pvmove works as follows:
219
220 1. A temporary 'pvmove' LV is created to store details of all the data
221 movements required.
222
223 2. Every LV in the VG is searched for contiguous data that need moving
224 according to the command line arguments. For each piece of data found,
225 a new segment is added to the end of the pvmove LV. This segment takes
226 the form of a temporary mirror to copy the data from the original loca‐
227 tion to a newly allocated location. The original LV is updated to use
228 the new temporary mirror segment in the pvmove LV instead of accessing
229 the data directly.
230
231 3. The VG metadata is updated on disk.
232
233 4. The first segment of the pvmove LV is activated and starts to mirror
234 the first part of the data. Only one segment is mirrored at once as
235 this is usually more efficient.
236
237 5. A daemon repeatedly checks progress at the specified time interval.
238 When it detects that the first temporary mirror is in sync, it breaks
239 that mirror so that only the new location for that data gets used and
240 writes a checkpoint into the VG metadata on disk. Then it activates
241 the mirror for the next segment of the pvmove LV.
242
243 6. When there are no more segments left to be mirrored, the temporary
244 LV is removed and the VG metadata is updated so that the LVs reflect
245 the new data locations.
246
247 Note that this new process cannot support the original LVM1 type of on-
248 disk metadata. Metadata can be converted using vgconvert(8).
249
250 If the --atomic option is used, a slightly different approach is used
251 for the move. Again, a temporary 'pvmove' LV is created to store the
252 details of all the data movements required. This temporary LV contains
253 all the segments of the various LVs that need to be moved. However, in
254 this case, an identical LV is allocated that contains the same number
255 of segments and a mirror is created to copy the contents from the first
256 temporary LV to the second. After a complete copy is made, the tempo‐
257 rary LVs are removed, leaving behind the segments on the destination
258 PV. If an abort is issued during the move, all LVs being moved will
259 remain on the source PV.
260
261
263 Move all physical extents that are used by simple LVs on the specified
264 PV to free physical extents elsewhere in the VG.
265 pvmove /dev/sdb1
266
267 Use a specific destination PV when moving physical extents.
268 pvmove /dev/sdb1 /dev/sdc1
269
270 Move extents belonging to a single LV.
271 pvmove -n lvol1 /dev/sdb1 /dev/sdc1
272
273 Rather than moving the contents of an entire device, it is possible to
274 move a range of physical extents, for example numbers 1000 to 1999
275 inclusive on the specified PV.
276 pvmove /dev/sdb1:1000-1999
277
278 A range of physical extents to move can be specified as start+length.
279 For example, starting from PE 1000. (Counting starts from 0, so this
280 refers to the 1001st to the 2000th PE inclusive.)
281 pvmove /dev/sdb1:1000+1000
282
283 Move a range of physical extents to a specific PV (which must have suf‐
284 ficient free extents).
285 pvmove /dev/sdb1:1000-1999 /dev/sdc1
286
287 Move a range of physical extents to specific new extents on a new PV.
288 pvmove /dev/sdb1:1000-1999 /dev/sdc1:0-999
289
290 If the source and destination are on the same disk, the anywhere allo‐
291 cation policy is needed.
292 pvmove --alloc anywhere /dev/sdb1:1000-1999 /dev/sdb1:0-999
293
294 The part of a specific LV present within in a range of physical extents
295 can also be picked out and moved.
296 pvmove -n lvol1 /dev/sdb1:1000-1999 /dev/sdc1
297
299 lvm(8) lvm.conf(5) lvmconfig(8)
300
301 pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8)
302 pvresize(8) pvs(8) pvscan(8)
303
304 vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgcon‐
305 vert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimport‐
306 clone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8)
307 vgs(8) vgscan(8) vgsplit(8)
308
309 lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvre‐
310 duce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)
311
312 lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeacti‐
313 vate(8) lvmdump(8)
314
315 dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8)
316 cmirrord(8) lvmdbusd(8)
317
318 lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)
319
320
321
322Red Hat, Inc. LVM TOOLS 2.02.183(2) (2018-12-07) PVMOVE(8)