How to check used space for pvdisplay?

0

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.

Free Aac

Posted 2017-09-06T07:00:26.803

Reputation: 1

Answers

0

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.

mtak

Posted 2017-09-06T07:00:26.803

Reputation: 11 805

thanks for reply. actually we are displaying both du and fu in reports. For aix it is fine but coming to linux fu is good but du showing 99% by using cat /proc/partitions we are calculating DU. Both DU and FU are differently coming in reports – Free Aac – 2017-09-06T11:22:00.743

Why not just use the df command? – mtak – 2017-09-06T14:10:42.827

By using df we are already calculating FU. – Free Aac – 2017-09-11T07:29:53.597