JAEN

Linux

pvs / vgs / lvs

SafeInspect LVM layout

lvs

Lists PVs, VGs and LVs. VFree on vgs tells you how much room you have to grow.

Examples

  • vgsCheck free extents
  • lvs -a -o +devicesWhich physical volumes each LV uses
  • pvcreate /dev/sdb && vgextend vg01 /dev/sdbAdd a disk and grow the VG
  • lvextend -r -L +20G /dev/vg01/lv_dataGrow the LV and its file system by 20 GB

Syntax

pvs / vgs / lvs [-a -o +devices]

Key points

  • Growth goes disk (PV) → VG → LV → file system. lvextend -r handles the file-system step too.
  • If VFree in vgs is 0, add a disk before growing an LV.
  • XFS cannot be shrunk, so size such volumes conservatively.

When it does not work

  • If df shows the old size after lvextend, the file system was not grown. Run xfs_growfs <mount point> for XFS or resize2fs <device> for ext4.
  • If a new disk does not appear, rescan with echo "- - -" > /sys/class/scsi_host/host0/scan.

Before you run it

Read only.

Related commands

The same reference, with no signal at all

Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).

Get it free on the App Store