Before a hard drive or partition can be used in an LVM system it needs to be initialised. These physical volumes (PVs) can be created with pvcreate, and allows us to create Volume Groups.

CommandDescription
pvcreateInitialises a raw storage devices and marks it as a PV
pvdisplayDisplay detailed information about a physical volume
pvsDisplay a summarized list of all initialised PVs
pvscanScans system for all physical volumes
pvremoveRemove a PV from LVM
pvresizeIncrease/decrease size of a physical volume
pvmoveMove data from one PV to another

Physical volume management

pvcreate

Creating a physical volume is the first step in preparing a drive or partition for use in a Linux LVM setup. Once created, we can use pvdisplay to get information about the volume or pvs to get a summary of all initialised PVs.

Example

To create a new physical volume and then see data about it:

pvcreate /dev/sdX
>> Phyisical volume "/dev/sdX" successfully created
 
pvdisplay /dev/sdX
>>--- Physical volume ---
>>PV Name    /dev/sdX
>>VG Name    <not assigned>
>>...etc

Once a physical volume is created, it can be included in a volume group

pvdisplay

pvdisplay will show us information such as size, UUID, and whether it belongs to a VG.

pvs

This gives us general information with multiple columns that describe the existing physical volumes in the system:

PVVGFmtAttrPSizePFree
/dev/sdXvg01lvm2a--200.00G50.00G

pvscan

Used when adding new storage or to re scan existing PVs. This is used when you suspect disks aren’t being recognised in order to begin troubleshooting.

Physical volume modification

With Linux LVM physical volumes can be modified to move data around them, resize the storage pools, or remove the volumes when no longer needed.

pvresize

pvmove

pvremove

When removing a physical volume from LVM, the PV must first be removed from any Volume Group it belongs to.