]> sourceware.org Git - lvm2.git/blame - man/pvcreate.8.in
update reworded string
[lvm2.git] / man / pvcreate.8.in
CommitLineData
5951ef33 1.TH PVCREATE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
922ce479
AK
2.SH NAME
3pvcreate \- initialize a disk or partition for use by LVM
4.SH SYNOPSIS
5.B pvcreate
a1dbe74c
ZK
6.RB [ \-d | \-\-debug ]
7.RB [ \-h | \-\-help ]
8.RB [ \-t | \-\-test ]
9.RB [ \-v | \-\-verbose ]
10.RB [ \-\-version ]
922ce479
AK
11.RB [ \-f [ f ]| \-\-force " [" \-\-force ]]
12.RB [ \-y | \-\-yes ]
5a52dca9 13.RB [ \-\-labelsector ]
667d14e3
ZK
14.RB [ \-M | \-\-metadatatype " " \fItype ]
15.RB [ \-\-[pv]metadatacopies " " \fI#copies ]
16.RB [ \-\-metadatasize " " \fIsize ]
17.RB [ \-\-metadataignore " {" \fIy | \fIn }]
18.RB [ \-\-dataalignment " " \fIalignment ]
19.RB [ \-\-dataalignmentoffset " " \fIalignment_offset ]
20.RB [ \-\-restorefile " " \fIfile ]
dff22466 21.RB [ \-\-norestorefile ]
667d14e3
ZK
22.RB [ \-\-setphysicalvolumesize " " \fIsize ]
23.RB [ \-u | \-\-uuid " " \fIuuid ]
24.RB [ \-Z | \-\-zero " {" \fIy | \fIn }]
922ce479
AK
25.IR PhysicalVolume " [" PhysicalVolume ...]
26.SH DESCRIPTION
27.B pvcreate
28initializes
29.I PhysicalVolume
30for later use by the Logical Volume Manager (LVM). Each
31.I PhysicalVolume
32can be a disk partition, whole disk, meta device, or loopback file.
5a52dca9 33For DOS disk partitions, the partition id should be set to 0x8e using
922ce479
AK
34.BR fdisk "(8), " cfdisk "(8), "
35or a equivalent. For
36.B whole disk devices only
37the partition table must be erased, which will effectively destroy all
38data on that disk. This can be done by zeroing the first sector with:
39.sp
40.BI "dd if=/dev/zero of=" PhysicalVolume " bs=512 count=1"
41.sp
42Continue with
43.BR vgcreate (8)
44to create a new volume group on
45.IR PhysicalVolume ,
46or
47.BR vgextend (8)
48to add
49.I PhysicalVolume
50to an existing volume group.
51.SH OPTIONS
add7dc2d 52See \fBlvm\fP(8) for common options.
922ce479
AK
53.TP
54.BR \-f ", " \-\-force
55Force the creation without any confirmation. You can not recreate
56(reinitialize) a physical volume belonging to an existing volume group.
667d14e3 57In an emergency you can override this behaviour with \fB-ff\fP.
add7dc2d 58.TP
667d14e3 59.BR \-u ", " \-\-uuid " " \fIuuid
add7dc2d
AK
60Specify the uuid for the device.
61Without this option, \fBpvcreate\fP generates a random uuid.
62All of your physical volumes must have unique uuids.
5a52dca9 63You need to use this option before restoring a backup of LVM metadata
dff22466
MS
64onto a replacement device - see \fBvgcfgrestore\fP(8). As such, use of
65\fB--restorefile\fP is compulsory unless the \fB--norestorefile\fP is
66used.
922ce479
AK
67.TP
68.BR \-y ", " \-\-yes
69Answer yes to all questions.
2245e1c4 70.TP
667d14e3 71.BR \-Z ", " \-\-zero " " \fIy | \fIn
2245e1c4
AK
72Whether or not the first 4 sectors (2048 bytes) of the device should be
73wiped.
74If this option is not given, the
667d14e3
ZK
75default is to wipe these sectors unless either or both of the \fB--restorefile\fP
76or \fB--uuid\fP options were specified.
5a52dca9
AK
77.SH NEW METADATA OPTIONS
78LVM2 introduces a new format for storing metadata on disk.
79This new format is more efficient and resilient than the format the
80original version of LVM used and offers the advanced user greater
81flexibility and control.
82.sp
83The new format may be selected on the command line with \fB-M2\fP or by
84setting \fBformat = "lvm2"\fP in the \fBglobal\fP section of \fBlvm.conf\fP.
85Each physical volume in the same volume group must use the same format, but
86different volume groups on a machine may use different formats
87simultaneously: the tools can handle both formats.
88Additional formats can be added as shared libraries.
89.sp
90Additional tools for manipulating the locations and sizes of metadata areas
91will be written in due course. Use the verbose/debug options on the tools
92to see where the metadata areas are placed.
93.TP
667d14e3 94.BI \-\-metadatasize " size"
5a52dca9
AK
95The approximate amount of space to be set aside for each metadata area.
96(The size you specify may get rounded.)
97.TP
667d14e3 98.BI \-\-dataalignment " alignment"
04b2a4bd 99Align the start of the data to a multiple of this number.
667d14e3 100You should also specify an appropriate \fIPhysicalExtentSize\fP when creating
8929ce66
AK
101the Volume Group with \fBvgcreate\fP.
102.sp
103To see the location of the first Physical Extent of an existing Physical Volume
104use \fBpvs -o +pe_start\fP . It will be a multiple of the requested
667d14e3
ZK
105alignment. In addition it may be shifted by \fIalignment_offset\fP from
106\fIdata_alignment_offset_detection\fP (if enabled in \fBlvm.conf\fP) or
04b2a4bd
MS
107\fB--dataalignmentoffset\fP.
108.TP
667d14e3
ZK
109.BI \-\-dataalignmentoffset " alignment_offset"
110Shift the start of the data area by this additional \fIalignment_offset\fP.
8929ce66 111.TP
667d14e3 112.BI \-\-[pv]metadatacopies " copies"
5a52dca9
AK
113The number of metadata areas to set aside on each PV. Currently
114this can be 0, 1 or 2.
f3b0ea28 115If set to 2, two copies of the volume group metadata
5a52dca9 116are held on the PV, one at the front of the PV and one at the end.
f3b0ea28
AK
117If set to 1 (the default), one copy is kept at the front of the PV
118(starting in the 5th sector).
5a52dca9
AK
119If set to 0, no copies are kept on this PV - you might wish to use this
120with VGs containing large numbers of PVs. But if you do this and
121then later use \fBvgsplit\fP you must ensure that each VG is still going
122to have a suitable number of copies of the metadata after the split!
123.TP
667d14e3 124.BI \-\-metadataignore " y" \fR| n
8c013d78
DW
125Ignore or un-ignore metadata areas on this physical volume.
126The default is "n". This setting can be changed with \fBpvchange\fP.
127If metadata areas on a physical volume are ignored, LVM will
8010df8b 128not store metadata in the metadata areas present on this Physical
1c0c6cc8
DW
129Volume. Metadata areas cannot be created or extended after Logical
130Volumes have been allocated on the device. If you do not want to store
131metadata on this device, it is still wise always to allocate a metadata
132area in case you need it in the future and to use this option to instruct
133LVM2 to ignore it.
134.TP
667d14e3 135.BI \-\-restorefile " file"
5a52dca9
AK
136In conjunction with \fB--uuid\fP, this extracts the location and size
137of the data on the PV from the file (produced by \fBvgcfgbackup\fP)
138and ensures that the metadata that the program produces is consistent
139with the contents of the file i.e. the physical extents will be in
140the same place and not get overwritten by new metadata. This provides
141a mechanism to upgrade the metadata format or to add/remove metadata
142areas. Use with care. See also \fBvgconvert\fP(8).
143.TP
667d14e3
ZK
144.B \-\-norestorefile
145In conjunction with \fB--uuid\fP, this allows a \fIuuid\fP to be specified
dff22466
MS
146without also requiring that a backup of the metadata be provided.
147.TP
667d14e3 148.BI \-\-labelsector " sector"
5a52dca9
AK
149By default the PV is labelled with an LVM2 identifier in its second
150sector (sector 1). This lets you use a different sector near the
151start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS
152in the source). Use with care.
153.TP
667d14e3 154.BI \-\-setphysicalvolumesize " size"
5a52dca9 155Overrides the automatically-detected size of the PV. Use with care.
04b2a4bd 156.SH EXAMPLES
922ce479
AK
157Initialize partition #4 on the third SCSI disk and the entire fifth
158SCSI disk for later use by LVM:
159.sp
160.B pvcreate /dev/sdc4 /dev/sde
161.sp
04b2a4bd
MS
162If the 2nd SCSI disk is a 4KB sector drive that compensates for windows
163partitioning (sector 7 is the lowest aligned logical block, the 4KB
164sectors start at LBA -1, and consequently sector 63 is aligned on a 4KB
165boundary) manually account for this when initializing for use by LVM:
166.sp
167.B pvcreate --dataalignmentoffset 7s /dev/sdb
168.sp
922ce479 169.SH SEE ALSO
04b2a4bd 170.BR lvm.conf (5),
5951ef33
AK
171.BR lvm (8),
172.BR vgcreate (8),
173.BR vgextend (8),
174.BR lvcreate (8),
175.BR cfdisk (8),
176.BR fdisk (8),
177.BR losetup (8),
178.BR mdadm (8),
179.BR vgcfgrestore (8),
180.BR vgconvert (8)
This page took 0.088167 seconds and 5 git commands to generate.