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