Over the last couple of years I have made some small and not so small improvements to the LVM scripts for HP-UX. Most notably additional options/toggles were added that make the scripts more interesting:

vgs.pl

To limit the output to PE (physical extent) info:

# vgs.pl --pe

VG                PVs   LVs   Status               Version  PE Size  PE Total   PE Alloc   PE Free    Max PE/PV
vg00              1     9     available            1.0      64       3035       1549       1486       3035
vg_evtdump        0     0     deactivated          n/a      0        0          0          0          0
vg_evtdump1       0     0     deactivated          n/a      0        0          0          0          0
vg_evtdump2       0     0     deactivated          n/a      0        0          0          0          0
vg_evtdump3       0     0     deactivated          n/a      0        0          0          0          0
vg_evtdump4       0     0     deactivated          n/a      0        0          0          0          0
vg_eztdump        1     1     available,exclusive  2.2      64       895        895        0          8000
vg_eztdump1       1     1     available,exclusive  2.2      64       175        175        0          8000
vg_eztdump2       1     1     available,exclusive  2.2      64       255        255        0          8000
vg_eztdump3       1     1     available,exclusive  2.2      64       95         95         0          8000
vg_eztdump4       1     1     available,exclusive  2.2      64       95         95         0          8000
...

To limit the output to PV (physical volume) info:

# vgs.pl --pv

VG                PVs   LVs   Status               Version  Max PV   Act PV   PVGs     Max PE/PV
vg00              1     9     available            1.0      16       1        0        3035
vg_evtdump        0     0     deactivated          n/a      0        0        0        0
vg_evtdump1       0     0     deactivated          n/a      0        0        0        0
vg_evtdump2       0     0     deactivated          n/a      0        0        0        0
vg_evtdump3       0     0     deactivated          n/a      0        0        0        0
vg_evtdump4       0     0     deactivated          n/a      0        0        0        0
vg_eztdump        1     1     available,exclusive  2.2      2048     1        0        8000
vg_eztdump1       1     1     available,exclusive  2.2      2048     1        0        8000
vg_eztdump2       1     1     available,exclusive  2.2      2048     1        0        8000
vg_eztdump3       1     1     available,exclusive  2.2      2048     1        0        8000
vg_eztdump4       1     1     available,exclusive  2.2      2048     1        0        8000
...

To limit the output to active VGs only:

vgs.pl --active

VG                PVs   LVs   Status               Version  PE Size  VG Size    VG Free    VG Max     VG Major/Minor
vg00              1     9     available            1.0      64       190        93         3035        64/0x1e0000
vg_eztdump        1     1     available,exclusive  2.2      64       56         0          500        128/0x173000
vg_eztdump1       1     1     available,exclusive  2.2      64       11         0          500        128/0x177000
vg_eztdump2       1     1     available,exclusive  2.2      64       16         0          500        128/0x176000
vg_eztdump3       1     1     available,exclusive  2.2      64       6          0          500        128/0x178000
vg_eztdump4       1     1     available,exclusive  2.2      64       6          0          500        128/0x185000
...

lvs.pl

To show FS filesystems related info:

# lvs.pl --fs

LV                               VG                Status            Size    Extents    Filesystem           FS size    FS free
/dev/vg00/lvol1                  vg00              available,syncd   2       32         /stand               2          2
/dev/vg00/lvol2                  vg00              available,syncd   8       128        -                    0          0
/dev/vg00/lvol3                  vg00              available,syncd   9       135        /                    9          6
/dev/vg00/lvol4                  vg00              available,syncd   4       60         /home                4          1
/dev/vg00/lvol5                  vg00              available,syncd   20      320        /opt                 20         8
/dev/vg00/lvol6                  vg00              available,syncd   5       80         /tmp                 5          3
/dev/vg00/lvol7                  vg00              available,syncd   12      192        /usr                 12         8
/dev/vg00/lvol8                  vg00              available,syncd   31      490        /var                 31         11
/dev/vg00/lvol9                  vg00              available,syncd   7       112        /var/adm/crash       7          7
/dev/vg_eztdump/lvdat1           vg_eztdump        available,syncd   56      895        /EZT/d               56         13
/dev/vg_eztdump1/lvdat1          vg_eztdump1       available,syncd   11      175        /EZT/d1              11         6
/dev/vg_eztdump2/lvdat1          vg_eztdump2       available,syncd   16      255        /EZT/d2              15         15
/dev/vg_eztdump3/lvdat1          vg_eztdump3       available,syncd   6       95         /EZT/d3              6          6
/dev/vg_eztdump4/lvdat1          vg_eztdump4       available,syncd   6       95         /EZT/d4              6          6
/dev/vg_eqtdump/lvdat1           vg_eqtdump        available,syncd   101     1615       /EQT/d               99         43

Comments