Determine space on a disk

Hello, I am trying to understand how to calculate actual disk space on a logical volume. Based on the output below, how would I convert the total and free PPs to MB and GB? Thank you.


# lsvg rootvg
VOLUME GROUP:       rootvg                   VG IDENTIFIER:  000a8dac00004c00000000fca4046498
VG STATE:           active                   PP SIZE:        128 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      1092 (139776 megabytes)
MAX LVs:            256                      FREE PPs:       307 (39296 megabytes)
LVs:                18                       USED PPs:       785 (100480 megabytes)
OPEN LVs:           17                       QUORUM:         1
TOTAL PVs:          2                        VG DESCRIPTORS: 3
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         2                        AUTO ON:        yes
MAX PPs per VG:     32512
MAX PPs per PV:     1016                     MAX PVs:        32
LTG size:           128 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable


# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            546         232         11..00..03..109..109
hdisk3            active            546         75          15..00..02..00..58

David

David,

All the information you need is given by "# lsvg rootvg"

In your example, the PP size for rootvg is 128 megabytes.

Total PP's for the volume group is 1092, so the total size of the volume group is 128 x 1092, which is 139776 megabytes, (136.5 Gb)

Free PP's is 307, so you have 307 x 1092 megabytes free, which is 39296Mb, or about 38Gb.

Tony, this helps a lot. Did you mean that the free calculation is 307 x 128 instead of 307 x 1092? Thank you kindly.

  • David

Yep, thats exactly what I meant.

When a disk is added to a VG it is sliced to pieces of PPsize. These pieces are then added to LVs, quasi one at a time.

Therefore, to find out how much space a disk in a vg provides you can calculate the number of PPs it provides times the size of one such PP.

If you want to know the raw disk size you could try the "size_in_mb" attribute in the device database. Not all disk types support this attribute, however. For example get the size of a 36GB SCSI disk used as "hdisk0":

root@aix_5_3 # lsdev -l hdisk0
hdisk0 Available 7M-08-00-8,0 16 Bit LVD SCSI Disk Drive

root@aix_5_3 # lsattr -F value -l hdisk0 -a size_in_mb
36400

You could also use the "bootinfo -s" command to get the diskspace. The results differ slightly from the output of "lsattr" because the one reports formatted and the other raw diskspace.

root@aix_5_3 # bootinfo -s hdisk0
34715

I hope this helps.

bakunin