Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / contrib / lvm2 / dist / man / pvmove.8
1 .\"    $NetBSD: pvmove.8,v 1.3 2010/02/18 14:00:39 wiz Exp $
2 .\"
3 .TH PVMOVE 8 "LVM TOOLS 2.02.44-cvs (02-17-09)" "Sistina Software UK" \" -*- nroff -*-
4 .SH NAME
5 pvmove \- move physical extents
6 .SH SYNOPSIS
7 .B pvmove
8 [\-\-abort]
9 [\-\-alloc AllocationPolicy]
10 [\-b|\-\-background]
11 [\-d|\-\-debug] [\-h|\-\-help] [\-i|\-\-interval Seconds] [\-v|\-\-verbose]
12 [\-n|\-\-name LogicalVolume] 
13 [SourcePhysicalVolume[:PE[-PE]...] [DestinationPhysicalVolume[:PE[-PE]...]...]]
14 .SH DESCRIPTION
15 .B pvmove
16 allows you to move the allocated physical extents (PEs) on
17 .I SourcePhysicalVolume
18 to one or more other physical volumes (PVs).
19 You can optionally specify a source
20 .I LogicalVolume
21 in which case only extents used by that LV will be moved to 
22 free (or specified) extents on
23 .IR DestinationPhysicalVolume (s).
24 If no
25 .I DestinationPhysicalVolume
26 is specified, the normal allocation rules for the volume group are used.
27
28 If \fBpvmove\fP gets interrupted for any reason (e.g. the machine crashes)
29 then run \fBpvmove\fP again without any PhysicalVolume arguments to
30 restart any moves that were in progress from the last checkpoint.
31 Alternatively use \fBpvmove --abort\fP at any time to abort them
32 at the last checkpoint.
33
34 You can run more than one pvmove at once provided they are moving data
35 off different SourcePhysicalVolumes, but additional pvmoves will ignore
36 any logical volumes already in the process of being changed, so some
37 data might not get moved.
38
39 \fBpvmove\fP works as follows:
40
41 1. A temporary 'pvmove' logical volume is created to store
42 details of all the data movements required.
43
44 2. Every logical volume in the volume group is searched
45 for contiguous data that need moving
46 according to the command line arguments.
47 For each piece of data found, a new segment is added to the end of the
48 pvmove LV.
49 This segment takes the form of a temporary mirror to copy the data 
50 from the original location to a newly-allocated location. 
51 The original LV is updated to use the new temporary mirror segment
52 in the pvmove LV instead of accessing the data directly.
53
54 3. The volume group metadata is updated on disk.
55
56 4. The first segment of the pvmove logical volume is activated and starts
57 to mirror the first part of the data.  Only one segment is mirrored at once
58 as this is usually more efficient.
59
60 5. A daemon repeatedly checks progress at the specified time interval.
61 When it detects that the first temporary mirror is in-sync,
62 it breaks that mirror so that only the new location for that data gets used 
63 and writes a checkpoint into the volume group metadata on disk.
64 Then it activates the mirror for the next segment of the pvmove LV.
65
66 6. When there are no more segments left to be mirrored, 
67 the temporary logical volume is removed and the volume group metadata 
68 is updated so that the logical volumes reflect the new data locations.
69
70 Note that this new process cannot support the original LVM1
71 type of on-disk metadata.  Metadata can be converted using \fBvgconvert\fP(8).
72
73 .SH OPTIONS
74 .TP
75 .I \-\-abort
76 Abort any moves in progress.
77 .TP
78 .I \-b, \-\-background
79 Run the daemon in the background.
80 .TP
81 .I \-i, \-\-interval Seconds
82 Report progress as a percentage at regular intervals.
83 .TP
84 .I \-n, \-\-name " \fILogicalVolume\fR"
85 Move only the extents belonging to
86 .I LogicalVolume
87 from
88 .I SourcePhysicalVolume
89 instead of all allocated extents to the destination physical volume(s).
90
91 .SH EXAMPLES
92 To move all logical extents of any logical volumes on
93 .B /dev/hda4
94 to free physical extents elsewhere in the volume group, giving verbose
95 runtime information, use:
96 .sp
97 \       pvmove -v /dev/hda4
98 .sp
99 .SH SEE ALSO
100 .BR lvm (8),
101 .BR vgconvert (8)