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 al‐
28 ready 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|json_std ]
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 [ --devices PV ]
65 [ --devicesfile String ]
66 [ --driverloaded y|n ]
67 [ --journal String ]
68 [ --lockopt String ]
69 [ --longhelp ]
70 [ --nohints ]
71 [ --nolocking ]
72 [ --profile String ]
73 [ --version ]
74
76 --abort
77 Abort any pvmove operations in progress. If a pvmove was started
78 with the --atomic option, then all LVs will remain on the source
79 PV. Otherwise, segments that have been moved will remain on the
80 destination PV, while unmoved segments will remain on the source
81 PV.
82
83 --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
84 Determines the allocation policy when a command needs to allo‐
85 cate Physical Extents (PEs) from the VG. Each VG and LV has an
86 allocation policy which can be changed with vgchange/lvchange,
87 or overridden on the command line. normal applies common sense
88 rules such as not placing parallel stripes on the same PV. in‐
89 herit applies the VG policy to an LV. contiguous requires new
90 PEs be placed adjacent to existing PEs. cling places new PEs on
91 the same PV as existing PEs in the same stripe of the LV. If
92 there are sufficient PEs for an allocation, but normal does not
93 use them, anywhere will use them even if it reduces performance,
94 e.g. by placing two stripes on the same PV. Optional positional
95 PV args on the command line can also be used to limit which PVs
96 the command will use for allocation. See lvm(8) for more infor‐
97 mation about allocation.
98
99 --atomic
100 Makes a pvmove operation atomic, ensuring that all affected LVs
101 are moved to the destination PV, or none are if the operation is
102 aborted.
103
104 -A|--autobackup y|n
105 Specifies if metadata should be backed up automatically after a
106 change. Enabling this is strongly advised! See vgcfgbackup(8)
107 for more information.
108
109 -b|--background
110 If the operation requires polling, this option causes the com‐
111 mand to return before the operation is complete, and polling is
112 done in the background.
113
114 --commandprofile String
115 The command profile to use for command configuration. See
116 lvm.conf(5) for more information about profiles.
117
118 --config String
119 Config settings for the command. These override lvm.conf(5) set‐
120 tings. The String arg uses the same format as lvm.conf(5), or
121 may use section/field syntax. See lvm.conf(5) for more informa‐
122 tion about config.
123
124 -d|--debug ...
125 Set debug level. Repeat from 1 to 6 times to increase the detail
126 of messages sent to the log file and/or syslog (if configured).
127
128 --devices PV
129 Restricts the devices that are visible and accessible to the
130 command. Devices not listed will appear to be missing. This op‐
131 tion can be repeated, or accepts a comma separated list of de‐
132 vices. This overrides the devices file.
133
134 --devicesfile String
135 A file listing devices that LVM should use. The file must exist
136 in /etc/lvm/devices/ and is managed with the lvmdevices(8) com‐
137 mand. This overrides the lvm.conf(5) devices/devicesfile and
138 devices/use_devicesfile settings.
139
140 --driverloaded y|n
141 If set to no, the command will not attempt to use device-mapper.
142 For testing and debugging.
143
144 -h|--help
145 Display help text.
146
147 -i|--interval Number
148 Report progress at regular intervals.
149
150 --journal String
151 Record information in the systemd journal. This information is
152 in addition to information enabled by the lvm.conf log/journal
153 setting. command: record information about the command. out‐
154 put: record the default command output. debug: record full com‐
155 mand debugging.
156
157 --lockopt String
158 Used to pass options for special cases to lvmlockd. See lvm‐
159 lockd(8) for more information.
160
161 --longhelp
162 Display long help text.
163
164 -n|--name String
165 Move only the extents belonging to the named LV.
166
167 --nohints
168 Do not use the hints file to locate devices for PVs. A command
169 may read more devices to find PVs when hints are not used. The
170 command will still perform standard hint file invalidation where
171 appropriate.
172
173 --nolocking
174 Disable locking. Use with caution, concurrent commands may pro‐
175 duce incorrect results.
176
177 --noudevsync
178 Disables udev synchronisation. The process will not wait for no‐
179 tification from udev. It will continue irrespective of any pos‐
180 sible udev processing in the background. Only use this if udev
181 is not running or has rules that ignore the devices LVM creates.
182
183 --profile String
184 An alias for --commandprofile or --metadataprofile, depending on
185 the command.
186
187 -q|--quiet ...
188 Suppress output and log messages. Overrides --debug and --ver‐
189 bose. Repeat once to also suppress any prompts with answer
190 'no'.
191
192 --reportformat basic|json|json_std
193 Overrides current output format for reports which is defined
194 globally by the report/output_format setting in lvm.conf(5).
195 basic is the original format with columns and rows. If there is
196 more than one report per command, each report is prefixed with
197 the report name for identification. json produces report output
198 in JSON format. json_std produces report output in JSON format
199 which is more compliant with JSON standard. See lvmreport(7)
200 for more information.
201
202 -t|--test
203 Run in test mode. Commands will not update metadata. This is
204 implemented by disabling all metadata writing but nevertheless
205 returning success to the calling function. This may lead to un‐
206 usual error messages in multi-stage operations if a tool relies
207 on reading back metadata it believes has changed but hasn't.
208
209 -v|--verbose ...
210 Set verbose level. Repeat from 1 to 4 times to increase the de‐
211 tail of messages sent to stdout and stderr.
212
213 --version
214 Display version information.
215
216 -y|--yes
217 Do not prompt for confirmation interactively but always assume
218 the answer yes. Use with extreme caution. (For automatic no,
219 see -qq.)
220
222 PV Physical Volume name, a device path under /dev. For commands
223 managing physical extents, a PV positional arg generally accepts
224 a suffix indicating a range (or multiple ranges) of physical ex‐
225 tents (PEs). When the first PE is omitted, it defaults to the
226 start of the device, and when the last PE is omitted it defaults
227 to end. Start and end range (inclusive): PV[:PE-PE]... Start
228 and length range (counting from 0): PV[:PE+PE]...
229
230 String See the option description for information about the string con‐
231 tent.
232
233 Size[UNIT]
234 Size is an input number that accepts an optional unit. Input
235 units are always treated as base two values, regardless of capi‐
236 talization, e.g. 'k' and 'K' both refer to 1024. The default
237 input unit is specified by letter, followed by |UNIT. UNIT rep‐
238 resents other possible input units: b|B is bytes, s|S is sectors
239 of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB,
240 p|P is PiB, e|E is EiB. (This should not be confused with the
241 output control --units, where capital letters mean multiple of
242 1000.)
243
245 See lvm(8) for information about environment variables used by lvm.
246 For example, LVM_VG_NAME can generally be substituted for a required VG
247 parameter.
248
250 pvmove works as follows:
251
252 1. A temporary 'pvmove' LV is created to store details of all the data
253 movements required.
254
255 2. Every LV in the VG is searched for contiguous data that need moving
256 according to the command line arguments. For each piece of data found,
257 a new segment is added to the end of the pvmove LV. This segment takes
258 the form of a temporary mirror to copy the data from the original loca‐
259 tion to a newly allocated location. The original LV is updated to use
260 the new temporary mirror segment in the pvmove LV instead of accessing
261 the data directly.
262
263 3. The VG metadata is updated on disk.
264
265 4. The first segment of the pvmove LV is activated and starts to mirror
266 the first part of the data. Only one segment is mirrored at once as
267 this is usually more efficient.
268
269 5. A daemon repeatedly checks progress at the specified time interval.
270 When it detects that the first temporary mirror is in sync, it breaks
271 that mirror so that only the new location for that data gets used and
272 writes a checkpoint into the VG metadata on disk. Then it activates
273 the mirror for the next segment of the pvmove LV.
274
275 6. When there are no more segments left to be mirrored, the temporary
276 LV is removed and the VG metadata is updated so that the LVs reflect
277 the new data locations.
278
279 Note that this new process cannot support the original LVM1 type of on-
280 disk metadata. Metadata can be converted using vgconvert(8).
281
282 If the --atomic option is used, a slightly different approach is used
283 for the move. Again, a temporary 'pvmove' LV is created to store the
284 details of all the data movements required. This temporary LV contains
285 all the segments of the various LVs that need to be moved. However, in
286 this case, an identical LV is allocated that contains the same number
287 of segments and a mirror is created to copy the contents from the first
288 temporary LV to the second. After a complete copy is made, the tempo‐
289 rary LVs are removed, leaving behind the segments on the destination
290 PV. If an abort is issued during the move, all LVs being moved will
291 remain on the source PV.
292
294 Move all physical extents that are used by simple LVs on the specified
295 PV to free physical extents elsewhere in the VG.
296 pvmove /dev/sdb1
297
298 Use a specific destination PV when moving physical extents.
299 pvmove /dev/sdb1 /dev/sdc1
300
301 Move extents belonging to a single LV.
302 pvmove -n lvol1 /dev/sdb1 /dev/sdc1
303
304 Rather than moving the contents of an entire device, it is possible to
305 move a range of physical extents, for example numbers 1000 to 1999 in‐
306 clusive on the specified PV.
307 pvmove /dev/sdb1:1000-1999
308
309 A range of physical extents to move can be specified as start+length.
310 For example, starting from PE 1000. (Counting starts from 0, so this
311 refers to the 1001st to the 2000th PE inclusive.)
312 pvmove /dev/sdb1:1000+1000
313
314 Move a range of physical extents to a specific PV (which must have suf‐
315 ficient free extents).
316 pvmove /dev/sdb1:1000-1999 /dev/sdc1
317
318 Move a range of physical extents to specific new extents on a new PV.
319 pvmove /dev/sdb1:1000-1999 /dev/sdc1:0-999
320
321 If the source and destination are on the same disk, the anywhere allo‐
322 cation policy is needed.
323 pvmove --alloc anywhere /dev/sdb1:1000-1999 /dev/sdb1:0-999
324
325 The part of a specific LV present within in a range of physical extents
326 can also be picked out and moved.
327 pvmove -n lvol1 /dev/sdb1:1000-1999 /dev/sdc1
328
330 lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8),
331
332 pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8),
333 pvremove(8), pvresize(8), pvs(8), pvscan(8),
334
335 vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8),
336 vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8),
337 vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8),
338 vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8),
339
340 lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8),
341 lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8),
342
343 lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8),
344
345 dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8),
346 lvmdbusd(8), fsadm(8),
347
348 lvmsystemid(7), lvmreport(7), lvmraid(7), lvmthin(7), lvmcache(7)
349
350
351
352Red Hat, Inc. LVM TOOLS 2.03.18(2)-git (2022-11-10) PVMOVE(8)