]> sourceware.org Git - lvm2.git/blob - man/pvmove.8.in
spacing
[lvm2.git] / man / pvmove.8.in
1 .TH PVMOVE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
2 .SH NAME
3 pvmove \- move physical extents
4 .SH SYNOPSIS
5 .B pvmove
6 .RB [ \-\-abort ]
7 .RB [ \-\-alloc
8 .IR AllocationPolicy ]
9 .RB [ \-b | \-\-background ]
10 .RB [ \-d | \-\-debug ]
11 .RB [ \-h | \-\-help ]
12 .RB [ \-i | \-\-interval
13 .IR Seconds ]
14 .RB [ \-\-noudevsync ]
15 .RB [ \-v | \-\-verbose ]
16 .RB [ \-n | \-\-name
17 .IR LogicalVolume ]
18 .RI [ SourcePhysicalVolume [ :PE [ -PE ]...]
19 .RI [ DestinationPhysicalVolume [ :PE [ -PE ]...]...]]
20 .SH DESCRIPTION
21 pvmove allows you to move the allocated physical extents (PEs) on
22 .I SourcePhysicalVolume
23 to one or more other physical volumes (PVs).
24 You can optionally specify a source
25 .I LogicalVolume
26 in which case only extents used by that LV will be moved to
27 free (or specified) extents on
28 .IR DestinationPhysicalVolume (s).
29 If no
30 .I DestinationPhysicalVolume
31 is specified, the normal allocation rules for the Volume Group are used.
32
33 If pvmove gets interrupted for any reason (e.g. the machine crashes)
34 then run pvmove again without any PhysicalVolume arguments to
35 restart any moves that were in progress from the last checkpoint.
36 Alternatively use \fBpvmove --abort\fP at any time to abort them
37 at the last checkpoint.
38
39 You can run more than one pvmove at once provided they are moving data
40 off different SourcePhysicalVolumes, but additional pvmoves will ignore
41 any Logical Volumes already in the process of being changed, so some
42 data might not get moved.
43
44 \fBpvmove\fP works as follows:
45
46 1. A temporary 'pvmove' Logical Volume is created to store
47 details of all the data movements required.
48
49 2. Every Logical Volume in the Volume Group is searched
50 for contiguous data that need moving
51 according to the command line arguments.
52 For each piece of data found, a new segment is added to the end of the
53 pvmove LV.
54 This segment takes the form of a temporary mirror to copy the data
55 from the original location to a newly-allocated location.
56 The original LV is updated to use the new temporary mirror segment
57 in the pvmove LV instead of accessing the data directly.
58
59 3. The Volume Group metadata is updated on disk.
60
61 4. The first segment of the pvmove Logical Volume is activated and starts
62 to mirror the first part of the data. Only one segment is mirrored at once
63 as this is usually more efficient.
64
65 5. A daemon repeatedly checks progress at the specified time interval.
66 When it detects that the first temporary mirror is in-sync,
67 it breaks that mirror so that only the new location for that data gets used
68 and writes a checkpoint into the Volume Group metadata on disk.
69 Then it activates the mirror for the next segment of the pvmove LV.
70
71 6. When there are no more segments left to be mirrored,
72 the temporary Logical Volume is removed and the Volume Group metadata
73 is updated so that the Logical Volumes reflect the new data locations.
74
75 Note that this new process cannot support the original LVM1
76 type of on-disk metadata. Metadata can be converted using \fBvgconvert\fP(8).
77
78 N.B. The moving of mirrors, snapshots and their origins is not yet supported.
79
80 .SH OPTIONS
81 See \fBlvm\fP(8) for common options.
82 .TP
83 .B \-\-abort
84 Abort any moves in progress.
85 .TP
86 .B \-\-noudevsync
87 Disable udev synchronisation. The
88 process will not wait for notification from udev.
89 It will continue irrespective of any possible udev processing
90 in the background. You should only use this if udev is not running
91 or has rules that ignore the devices LVM2 creates.
92 .TP
93 .BR \-b ", " \-\-background
94 Run the daemon in the background.
95 .TP
96 .BR \-i ", " \-\-interval " " \fISeconds
97 Report progress as a percentage at regular intervals.
98 .TP
99 .BR \-n ", " \-\-name " " \fILogicalVolume
100 Move only the extents belonging to
101 .I LogicalVolume
102 from
103 .I SourcePhysicalVolume
104 instead of all allocated extents to the destination physical volume(s).
105
106 .SH Examples
107 To move all Physical Extents that are used by simple Logical Volumes on
108 /dev/sdb1 to free Physical Extents elsewhere in the Volume Group use:
109 .sp
110 .B pvmove /dev/sdb1
111 .P
112 Any mirrors, snapshots and their origins are left unchanged.
113 .P
114 Additionally, a specific destination device /dev/sdc1
115 can be specified like this:
116 .sp
117 .B pvmove /dev/sdb1 /dev/sdc1
118 .P
119 To perform the action only on extents belonging to the single Logical Volume
120 lvol1 do this:
121 .sp
122 .B pvmove -n lvol1 /dev/sdb1 /dev/sdc1
123 .P
124 Rather than moving the contents of the entire device, it is possible to
125 move a range of Physical Extents - for example numbers 1000 to 1999
126 inclusive on /dev/sdb1 - like this:
127 .sp
128 .B pvmove /dev/sdb1:1000-1999
129 .P
130 To move a range of Physical Extents to a specific location (which must have
131 sufficent free extents) use the form:
132 .sp
133 .B pvmove /dev/sdb1:1000-1999 /dev/sdc1
134 .sp
135 or
136 .sp
137 .B pvmove /dev/sdb1:1000-1999 /dev/sdc1:0-999
138 .P
139 If the source and destination are on the same disk, the
140 .B anywhere
141 allocation policy would be needed, like this:
142 .sp
143 .B pvmove --alloc anywhere /dev/sdb1:1000-1999 /dev/sdb1:0-999
144 .P
145 The part of a specific Logical Volume present within in a range of Physical
146 Extents can also be picked out and moved, like this:
147 .sp
148 .B pvmove -n lvol1 /dev/sdb1:1000-1999 /dev/sdc1
149 .SH SEE ALSO
150 .BR lvm (8),
151 .BR vgconvert (8)
152 .BR pvs (8)
This page took 0.041921 seconds and 5 git commands to generate.