1PVMOVE(8)                   System Manager's Manual                  PVMOVE(8)
2
3
4

NAME

6       pvmove - Move extents from one physical volume to another
7

SYNOPSIS

9       pvmove position_args
10           [ option_args ]
11           [ position_args ]
12

DESCRIPTION

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

USAGE

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

OPTIONS

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.  in‐
85              herit 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 no‐
149              tification from udev. It will continue irrespective of any pos‐
150              sible udev processing in the background. Only use this if udev
151              is not running or has rules that ignore the devices LVM creates.
152
153       --profile String
154              An alias for --commandprofile or --metadataprofile, depending on
155              the command.
156
157       -q|--quiet ...
158              Suppress output and log messages. Overrides --debug and --ver‐
159              bose.  Repeat once to also suppress any prompts with answer
160              'no'.
161
162       --reportformat basic|json
163              Overrides current output format for reports which is defined
164              globally by the report/output_format setting in lvm.conf.  basic
165              is the original format with columns and rows.  If there is more
166              than one report per command, each report is prefixed with the
167              report name for identification. json produces report output in
168              JSON format. See lvmreport(7) for more information.
169
170       -t|--test
171              Run in test mode. Commands will not update metadata.  This is
172              implemented by disabling all metadata writing but nevertheless
173              returning success to the calling function. This may lead to un‐
174              usual error messages in multi-stage operations if a tool relies
175              on reading back metadata it believes has changed but hasn't.
176
177       -v|--verbose ...
178              Set verbose level. Repeat from 1 to 4 times to increase the de‐
179              tail of messages sent to stdout and stderr.
180
181       --version
182              Display version information.
183
184       -y|--yes
185              Do not prompt for confirmation interactively but always assume
186              the answer yes. Use with extreme caution.  (For automatic no,
187              see -qq.)
188

VARIABLES

190       PV
191              Physical  Volume  name,  a device path under /dev.  For commands
192              managing physical extents, a PV positional arg generally accepts
193              a suffix indicating a range (or multiple ranges) of physical ex‐
194              tents (PEs). When the first PE is omitted, it  defaults  to  the
195              start of the device, and when the last PE is omitted it defaults
196              to end.  Start and end range (inclusive):  PV[:PE-PE]...   Start
197              and length range (counting from 0): PV[:PE+PE]...
198
199       String
200              See the option description for information about the string con‐
201              tent.
202
203       Size[UNIT]
204              Size is an input number that accepts an  optional  unit.   Input
205              units are always treated as base two values, regardless of capi‐
206              talization, e.g. 'k' and 'K' both refer to  1024.   The  default
207              input unit is specified by letter, followed by |UNIT.  UNIT rep‐
208              resents other possible input units:  bBsSkKmMgGtTpPeE.   b|B  is
209              bytes,  s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G
210              is GiB, t|T is TiB, p|P is PiB, e|E is EiB.  (This should not be
211              confused  with the output control --units, where capital letters
212              mean multiple of 1000.)
213

ENVIRONMENT VARIABLES

215       See lvm(8) for information about environment  variables  used  by  lvm.
216       For example, LVM_VG_NAME can generally be substituted for a required VG
217       parameter.
218

NOTES

220       pvmove works as follows:
221
222       1. A temporary 'pvmove' LV is created to store details of all the  data
223       movements required.
224
225       2.  Every LV in the VG is searched for contiguous data that need moving
226       according to the command line arguments.  For each piece of data found,
227       a new segment is added to the end of the pvmove LV.  This segment takes
228       the form of a temporary mirror to copy the data from the original loca‐
229       tion  to a newly allocated location.  The original LV is updated to use
230       the new temporary mirror segment in the pvmove LV instead of  accessing
231       the data directly.
232
233       3. The VG metadata is updated on disk.
234
235       4. The first segment of the pvmove LV is activated and starts to mirror
236       the first part of the data.  Only one segment is mirrored  at  once  as
237       this is usually more efficient.
238
239       5.  A daemon repeatedly checks progress at the specified time interval.
240       When it detects that the first temporary mirror is in sync,  it  breaks
241       that  mirror  so that only the new location for that data gets used and
242       writes a checkpoint into the VG metadata on disk.   Then  it  activates
243       the mirror for the next segment of the pvmove LV.
244
245       6.  When  there are no more segments left to be mirrored, the temporary
246       LV is removed and the VG metadata is updated so that  the  LVs  reflect
247       the new data locations.
248
249       Note that this new process cannot support the original LVM1 type of on-
250       disk metadata.  Metadata can be converted using vgconvert(8).
251
252       If the --atomic option is used, a slightly different approach  is  used
253       for  the  move.  Again, a temporary 'pvmove' LV is created to store the
254       details of all the data movements required.  This temporary LV contains
255       all the segments of the various LVs that need to be moved.  However, in
256       this case, an identical LV is allocated that contains the  same  number
257       of segments and a mirror is created to copy the contents from the first
258       temporary LV to the second.  After a complete copy is made, the  tempo‐
259       rary  LVs  are  removed, leaving behind the segments on the destination
260       PV.  If an abort is issued during the move, all LVs  being  moved  will
261       remain on the source PV.
262
263

EXAMPLES

265       Move  all physical extents that are used by simple LVs on the specified
266       PV to free physical extents elsewhere in the VG.
267       pvmove /dev/sdb1
268
269       Use a specific destination PV when moving physical extents.
270       pvmove /dev/sdb1 /dev/sdc1
271
272       Move extents belonging to a single LV.
273       pvmove -n lvol1 /dev/sdb1 /dev/sdc1
274
275       Rather than moving the contents of an entire device, it is possible  to
276       move  a range of physical extents, for example numbers 1000 to 1999 in‐
277       clusive on the specified PV.
278       pvmove /dev/sdb1:1000-1999
279
280       A range of physical extents to move can be specified  as  start+length.
281       For  example,  starting  from PE 1000. (Counting starts from 0, so this
282       refers to the 1001st to the 2000th PE inclusive.)
283       pvmove /dev/sdb1:1000+1000
284
285       Move a range of physical extents to a specific PV (which must have suf‐
286       ficient free extents).
287       pvmove /dev/sdb1:1000-1999 /dev/sdc1
288
289       Move a range of physical extents to specific new extents on a new PV.
290       pvmove /dev/sdb1:1000-1999 /dev/sdc1:0-999
291
292       If  the source and destination are on the same disk, the anywhere allo‐
293       cation policy is needed.
294       pvmove --alloc anywhere /dev/sdb1:1000-1999 /dev/sdb1:0-999
295
296       The part of a specific LV present within in a range of physical extents
297       can also be picked out and moved.
298       pvmove -n lvol1 /dev/sdb1:1000-1999 /dev/sdc1
299

SEE ALSO

301       lvm(8) lvm.conf(5) lvmconfig(8)
302
303       pvchange(8)  pvck(8)  pvcreate(8)  pvdisplay(8)  pvmove(8)  pvremove(8)
304       pvresize(8) pvs(8) pvscan(8)
305
306       vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8)  vgcreate(8)  vgcon‐
307       vert(8)  vgdisplay(8)  vgexport(8)  vgextend(8)  vgimport(8)  vgimport‐
308       clone(8) vgmerge(8) vgmknodes(8)  vgreduce(8)  vgremove(8)  vgrename(8)
309       vgs(8) vgscan(8) vgsplit(8)
310
311       lvcreate(8)  lvchange(8)  lvconvert(8)  lvdisplay(8)  lvextend(8) lvre‐
312       duce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)
313
314       lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeacti‐
315       vate(8) lvmdump(8)
316
317       dmeventd(8)  lvmpolld(8)  lvmlockd(8)  lvmlockctl(8)  cmirrord(8) lvmd‐
318       busd(8)
319
320       lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)
321
322
323
324Red Hat, Inc.          LVM TOOLS 2.03.11(2) (2021-01-08)             PVMOVE(8)
Impressum