3 .TH PVCREATE 8 "LVM TOOLS 2.02.44-cvs (02-17-09)" "Sistina Software UK" \" -*- nroff -*-
5 pvcreate \- initialize a disk or partition for use by LVM
8 .RB [ \-d | \-\-debug ]
9 .RB [ \-f [ f ]| \-\-force " [" \-\-force ]]
11 .RB [ \-h | \-\-help ]
12 .RB [ \-t | \-\-test ]
13 .RB [ \-v | \-\-verbose ]
14 .RB [ \-\-labelsector ]
15 .RB [ \-M | \-\-metadatatype type ]
16 .RB [ \-\-metadatacopies #copies ]
17 .RB [ \-\-metadatasize size ]
18 .RB [ \-\-restorefile file ]
19 .RB [ \-\-setphysicalvolumesize size ]
20 .RB [ \-u | \-\-uuid uuid ]
22 .RB [ \-Z | \-\-zero y|n ]
23 .IR PhysicalVolume " [" PhysicalVolume ...]
28 for later use by the Logical Volume Manager (LVM). Each
30 can be a disk partition, whole disk, meta device, or loopback file.
31 For DOS disk partitions, the partition id should be set to 0x8e using
32 .BR fdisk "(8), " cfdisk "(8), "
34 .B whole disk devices only
35 the partition table must be erased, which will effectively destroy all
36 data on that disk. This can be done by zeroing the first sector with:
38 .BI "dd if=/dev/zero of=" PhysicalVolume " bs=512 count=1"
42 to create a new volume group on
48 to an existing volume group.
50 See \fBlvm\fP(8) for common options.
52 .BR \-f ", " \-\-force
53 Force the creation without any confirmation. You can not recreate
54 (reinitialize) a physical volume belonging to an existing volume group.
55 In an emergency you can override this behaviour with -ff.
57 .BR \-u ", " \-\-uuid " uuid"
58 Specify the uuid for the device.
59 Without this option, \fBpvcreate\fP generates a random uuid.
60 All of your physical volumes must have unique uuids.
61 You need to use this option before restoring a backup of LVM metadata
62 onto a replacement device - see \fBvgcfgrestore\fP(8).
65 Answer yes to all questions.
67 .BR \-Z ", " \-\-zero " y|n"
68 Whether or not the first 4 sectors (2048 bytes) of the device should be
70 If this option is not given, the
71 default is to wipe these sectors unless either or both of the --restorefile
72 or --uuid options were specified.
73 .SH NEW METADATA OPTIONS
74 LVM2 introduces a new format for storing metadata on disk.
75 This new format is more efficient and resilient than the format the
76 original version of LVM used and offers the advanced user greater
77 flexibility and control.
79 The new format may be selected on the command line with \fB-M2\fP or by
80 setting \fBformat = "lvm2"\fP in the \fBglobal\fP section of \fBlvm.conf\fP.
81 Each physical volume in the same volume group must use the same format, but
82 different volume groups on a machine may use different formats
83 simultaneously: the tools can handle both formats.
84 Additional formats can be added as shared libraries.
86 Additional tools for manipulating the locations and sizes of metadata areas
87 will be written in due course. Use the verbose/debug options on the tools
88 to see where the metadata areas are placed.
90 .BR \-\-metadatasize " size"
91 The approximate amount of space to be set aside for each metadata area.
92 (The size you specify may get rounded.)
94 .BR \-\-metadatacopies " copies"
95 The number of metadata areas to set aside on each PV. Currently
96 this can be 0, 1 or 2.
97 If set to 2, two copies of the volume group metadata
98 are held on the PV, one at the front of the PV and one at the end.
99 If set to 1 (the default), one copy is kept at the front of the PV
100 (starting in the 5th sector).
101 If set to 0, no copies are kept on this PV - you might wish to use this
102 with VGs containing large numbers of PVs. But if you do this and
103 then later use \fBvgsplit\fP you must ensure that each VG is still going
104 to have a suitable number of copies of the metadata after the split!
106 .BR \-\-restorefile " file"
107 In conjunction with \fB--uuid\fP, this extracts the location and size
108 of the data on the PV from the file (produced by \fBvgcfgbackup\fP)
109 and ensures that the metadata that the program produces is consistent
110 with the contents of the file i.e. the physical extents will be in
111 the same place and not get overwritten by new metadata. This provides
112 a mechanism to upgrade the metadata format or to add/remove metadata
113 areas. Use with care. See also \fBvgconvert\fP(8).
115 .BR \-\-labelsector " sector"
116 By default the PV is labelled with an LVM2 identifier in its second
117 sector (sector 1). This lets you use a different sector near the
118 start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS
119 in the source). Use with care.
121 .BR \-\-setphysicalvolumesize " size"
122 Overrides the automatically-detected size of the PV. Use with care.
124 Initialize partition #4 on the third SCSI disk and the entire fifth
125 SCSI disk for later use by LVM:
127 .B pvcreate /dev/sdc4 /dev/sde
138 .BR vgcfgrestore (8),