• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL : How to find free space in a Volume Group in LVM

by admin

Knowing the free space remaining in a volume group is an important piece of information, especially when you want to :
1. add a new volume in the VG
2. add a new PV in the VG
3. extend an existing volume in the VG

Method 1 – using vgs command

vgs command simply puts the total size of the VG and free space directly.

# vgdisplay -v vg_os2 | grep Free
    Using volume group(s) on command line.
  Free  PE / Size       40672 / 158.88 GiB
  Total PE / Free PE    143072 / 40672

In most of the cases this command will be sufficient for you. In case you want details on PV level you can go for the method 2.

Method 2 – using vgdisplay command

Execute the command vgdisplay to get information of all volume groups on the system.

# vgdisplay

Example output is given below. The line “Free PE / Size” indicates the free physical extents in the VG and free space available in the VG respectively.

# vgdisplay
......
  --- Volume group ---
  VG Name               vg_os2
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  9
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                5
  Open LV               5
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               558.88 GiB
  PE Size               4.00 MiB
  Total PE              143072
  Alloc PE / Size       102400 / 400.00 GiB
  Free  PE / Size       40672 / 158.88 GiB
  VG UUID               BXrCkO-bip9-fqjB-h4yd-JdNL-fUEq-Vsh6cq

From the example above there are 40672 available PEs or 158.88 GiB of free space.

Finding free space in in all PVs in a VG

To determine the number of free PEs on each physical device that is part of a volume group, execute the following command:

# vgdisplay -v [vg_name]

This will show volume groups and the physical volumes that are associated with each volume group.

Finding free space in all VGs

To easily find the free space in all VGS, execute the below command.

# vgdisplay | grep Free

For example :

# vgdisplay | grep Free
    Using volume group(s) on command line.
  Free  PE / Size       127 / 508.00 MiB
  Free  PE / Size       480 / 1.88 GiB
  Free  PE / Size       40672 / 158.88 GiB

To find free space in a specific VG only, provice the VG name in the above command. For example:

# vgdisplay -v vg_os2 | grep Free
    Using volume group(s) on command line.
  Free  PE / Size       40672 / 158.88 GiB
  Total PE / Free PE    143072 / 40672

Filed Under: Linux

Some more articles you might also be interested in …

  1. nohup: command not found
  2. chacl Command Examples in Linux
  3. How to uninstall chromium-chromedriver from Ubuntu
  4. authconfig Command Examples in Linux
  5. rpmspec: command not found
  6. What is the difference between the -i and -U options used in rpm command in Linux
  7. “lambo new” Command Examples
  8. How to Disable IPv6 on Ubuntu 22.04 LTS Jammy Jellyfish
  9. “az account” Command Examples
  10. apt-cache: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright