System and processes

The pvdisplay command

Shows the details of each LVM physical volume: size, extents and group.

Most useful options

-a, --allAlso includes devices that are not PVs yet
-c, --colonColon separated output meant for scripts. For more control, use pvs
-C, --columnsShows the output in columns, like pvs, with the same field options
-m, --mapsShows which physical extents of the PV each logical volume uses, and where
-s, --shortShows only the size of the PVs given
-S, --select <criterio>Filters by criterion. Its syntax is shown by pvdisplay --select help

Copy-ready examples

$ pvdisplaydetails of all the physical volumes on the machine.
$ sudo pvdisplay /dev/sdcdetails of a single PV.

Example output

--- Physical volume ---
PV Name               /dev/sdc
VG Name               datos
PE Size               4.00 MiB
$ sudo pvdisplay -m /dev/sdcwhich extents each logical volume uses on that disk. Useful before taking it out of its group.
$ sudo pvdisplay -Cthe same information in columns, like pvs.

You can try them in the browser terminal: it does not touch your computer.

Common errors

MessageCauseFix
Failed to find physical volume "/dev/sdz".The device does not exist or is not a PV that LVM recognises.List the disks with lsblk and check the name. If the disk is not a PV, prepare it with pvcreate.

Typical mistakes

  • The PE (physical extent) is the unit in which space is handed out. By default it is 4 MiB; the group sets it with vgcreate -s.
  • A PV without a group shows as «--- NEW Physical volume ---», because it has no extent size yet.
  • pvdisplay -a also lists devices that are not PVs: do not treat it as an inventory of physical volumes.
  • To process the output in a script, use -c (colons) or pvs with --reportformat json, not the block format.

Differences from similar commands

  • pvs: gives the same information in a compact table. The pvdisplay manual page itself recommends pvs.
  • vgdisplay: shows the details of the volume group. pvdisplay shows those of each disk that makes it up.
  • lvdisplay: shows the details of a logical volume, what LVM offers on top of the PVs.

FAQ

What does «NEW Physical volume» mean in the output?

That the PV does not belong to any group yet, so it has no extent size (PE Size) assigned.

What are Total PE, Free PE and Allocated PE?

The physical extents of the PV: the total, the free ones and those already used by logical volumes. With -m you see which logical volume uses each one.

How do I see only the size of a PV?

With pvdisplay -s followed by the device, which shows only the size.

More System and processes commands

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course