linux - linux - How to check used space for pvdisplay? - answerstu - answerstu.com answerstu

linux - How to check used space for pvdisplay?

In AIX using lspv hdisk0, i am able to get total pps, free pps, used pps

TOTAL PPs:          1119 (71616 megabytes)   VG DESCRIPTORS:   2
FREE PPs:           272 (17408 megabytes)    HOT SPARE:        no
USED PPs:           847 (54208 megabytes)    MAX REQUEST:      256 kilobytes

In linux, i am getting

  $pvdisplay /dev/sda2
  PV Name               /dev/sda2
  VG Name               VolGroup
  PV Size               15.51 GiB / not usable 3.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              3970
  Free PE               0
  Allocated PE          3970

I am new to this, not able to understand this PE size,Total PE,Free PE

How to i get to know disk size, used space, free space using pvdisplay or any other command? How Free PE is showing 0 but df -h showing free disk space? I need to calculate Disk utilization not filesystem utilization.

1 Answer

  1. Bruce- Reply

    2019-11-15

    On Linux, PE's are allocated to a LV like they would be in a partition table. LVM doesn't care about the filesystem that's on the LV, and doesn't track which blocks are in use and which are not. Therefore all allocated PE's are not available for assignment to other LVs even if no data has been written to them.

    You have 0 free PE's to assign to LVs so you're stuck there. What you can do, depending on the filesystem you're running, is shrink it. Then you can reduce the size of an existing LV to free up PE's using lvreduce -L -5G /dev/vg/disk-name.

    If you need a metric for disk utilization, you could either say the disk is 100% in use, or you go by filesystem utilization and report that (which is a more useful metric in my opinion anyways). I would care more about filesystem utilization because that is the space that is actually available for applications to use. It also gets rid of other complexities like RAID factors and filesystem overhead.

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>