A new disk or partition cannot join an LVM storage stack until it has an LVM label. Creating a physical volume writes that label and the initial metadata to the chosen block device so it can later be assigned to a volume group.
The pvcreate command works on a whole disk such as /dev/sdb or on a partition such as /dev/sdb1. The examples use an unused whole disk; choose the device carefully because writing PV metadata changes the start of the target device.
Check the device table and existing signatures before initializing the PV. If wipefs reports a filesystem, partition table, RAID signature, or old LVM label that you still need, stop and recover or migrate that data before running pvcreate.
Related: How to create an LVM volume group
Related: How to add a disk to an LVM volume group
Related: How to remove an LVM physical volume
Steps to create an LVM physical volume:
- List block devices and choose the unused disk or partition.
$ lsblk --paths --output NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS NAME SIZE TYPE FSTYPE MOUNTPOINTS /dev/sda 80G disk `-/dev/sda1 80G part ext4 / /dev/sdb 100G disk
Use a device that is not mounted and does not contain data to keep. The sample target is /dev/sdb.
- Check for existing signatures on the target device.
$ sudo wipefs --no-act /dev/sdb
No output means wipefs did not find known filesystem, partition-table, RAID, or LVM signatures on the device.
If the command lists signatures you still need, do not continue; pvcreate writes LVM metadata to the device.
- Create the physical volume.
$ sudo pvcreate /dev/sdb Physical volume "/dev/sdb" successfully created.
Replace /dev/sdb with the confirmed target. Do not run this on a mounted filesystem, boot disk, or device that still holds data to preserve.
- Verify the new physical volume.
$ sudo pvs /dev/sdb PV VG Fmt Attr PSize PFree /dev/sdb lvm2 --- 100.00g 100.00g
An empty VG column shows the device is initialized as a PV but has not been assigned to a volume group yet.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.