$linuxjunkies
>

pvcreate(8)

Initialize a physical volume for use with LVM (Logical Volume Manager).

UbuntuDebianFedoraArch

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

FlagWhat it does
-f, --forceForce creation without prompts; useful for automation and overwriting existing metadata
-y, --yesAssume 'yes' for all prompts and warnings
-u, --uuid UUIDSet a specific UUID for the physical volume instead of generating one
--restorefile FILERestore PV metadata from a previously saved file (recovery mode)
-M, --metadatatype TYPESet metadata format: 'lvm2' (default) or 'lvm1' for older systems
--labelsector NUMBERSet the sector where the PV label is written (advanced; default is 1)
-Z, --zero yes|noWipe existing signatures and file systems from the device first (default: yes)
-v, --verboseShow additional output about the operation
--dataalignment SIZEAlign the data area to SIZE for better performance (e.g., 1M for SSDs)
--pvmetadatacopies NUMNumber 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/sdb1

Create two physical volumes from two entire disks in one command

pvcreate /dev/sdc /dev/sdd

Force initialization without prompts (overwrites existing metadata)

pvcreate -f /dev/sdb1

Wipe any existing signatures before initializing as a physical volume

pvcreate -Z y /dev/sdb1

Create PV with 1MB data alignment for SSD performance

pvcreate --dataalignment 1M /dev/sdb1

Initialize with a specific UUID (useful for recovery scenarios)

pvcreate -u 12345678-1234-1234-1234-123456789012 /dev/sdb1

Create three physical volumes with verbose output

pvcreate -v /dev/sdb1 /dev/sdc1 /dev/sdd1

Related commands