pvcreate(8)
Initialize a physical volume for use with LVM (Logical Volume Manager).
Synopsis
pvcreate [OPTION]... PHYSICAL_VOLUME [PHYSICAL_VOLUME]...Description
pvcreate prepares a block device (disk, partition, or loopback file) for use as a physical volume in LVM. It writes LVM metadata to the device, making it available to be added to a volume group. The device must not already contain a file system or be in use.
You can initialize one or more devices in a single command. After creation, use vgcreate to add the physical volume to a volume group, or vgextend to add it to an existing group.
Common options
| Flag | What it does |
|---|---|
-f, --force | Force creation without prompts; useful for automation and overwriting existing metadata |
-y, --yes | Assume 'yes' for all prompts and warnings |
-u, --uuid UUID | Set a specific UUID for the physical volume instead of generating one |
--restorefile FILE | Restore PV metadata from a previously saved file (recovery mode) |
-M, --metadatatype TYPE | Set metadata format: 'lvm2' (default) or 'lvm1' for older systems |
--labelsector NUMBER | Set the sector where the PV label is written (advanced; default is 1) |
-Z, --zero yes|no | Wipe existing signatures and file systems from the device first (default: yes) |
-v, --verbose | Show additional output about the operation |
--dataalignment SIZE | Align the data area to SIZE for better performance (e.g., 1M for SSDs) |
--pvmetadatacopies NUM | Number of metadata copies: 0, 1, or 2 (default: 1 or 2 depending on space) |
Examples
Initialize partition /dev/sdb1 as a physical volume
pvcreate /dev/sdb1Create two physical volumes from two entire disks in one command
pvcreate /dev/sdc /dev/sddForce initialization without prompts (overwrites existing metadata)
pvcreate -f /dev/sdb1Wipe any existing signatures before initializing as a physical volume
pvcreate -Z y /dev/sdb1Create PV with 1MB data alignment for SSD performance
pvcreate --dataalignment 1M /dev/sdb1Initialize with a specific UUID (useful for recovery scenarios)
pvcreate -u 12345678-1234-1234-1234-123456789012 /dev/sdb1Create three physical volumes with verbose output
pvcreate -v /dev/sdb1 /dev/sdc1 /dev/sdd1