I wrote a couple of Perl scripts that make querying basic LVM information on HP-UX hosts a bit easier and show info alike the much loved Linux tools pvs/vgs/lvs. I got the idea from Juanma’s LVM scripts but his original scripts throw back some errors or faulty information in certain circumstances and well they are a bit slow too. So I made a rewrite in Perl, getting rid of the errors and making it all a good bit faster too.

You can find the scripts at my Github hp-ux scripts repository: https://github.com/patvdv/hpux_scripts

Some examples are displayed in the following sections.

pvs

# pvs

PV                   VG         Status          PE Size PV Size  PV Free  Stale PE
/dev/disk/disk0_p2   vg00       available       32      119      43       0       
/dev/disk/disk3      vgswap     available       8       99       79       0       
/dev/disk/disk2      vglocal    available       8       79       9        0       
/dev/disk/disk4      vglocal    available       8       79       79       0       
/dev/disk/disk6      vgdbAA5    available       64      99       0        0       
/dev/disk/disk7      vgdbAA5    available       64      99       0        0       
/dev/disk/disk8      vgdbAA5    available       64      99       99       0       
/dev/disk/disk1      vgscsAA5   available       8       39       19       0

vgs

# vgs

VG         PVs   LVs   Status               Version  PE Size  VG Size    VG Free    VG Max    
vg00       1     11    available            1.0      32       119        43         1910      
vgswap     1     1     available            1.0      8        99         79         1600      
vglocal    2     3     available            2.2      8        159        89         200       
vgersAA5   0     0     deactivated          n/a      0        0          0          0         
vgdbAA5    3     11    available,exclusive  2.2      64       299        99         500       
vgscsAA5   1     1     available,exclusive  2.2      8        39         19         60

lvs

# lvs

LV                             VG           Status            Size   Permissions Mirrors Stripes  Allocation
/dev/vg00/lvol1                vg00         available,syncd   1       read,write        0       0  strict,contiguous
/dev/vg00/lvol2                vg00         available,syncd   8       read,write        0       0  strict,contiguous
/dev/vg00/lvol3                vg00         available,syncd   2       read,write        0       0  strict,contiguous
/dev/vg00/lvol4                vg00         available,syncd   1       read,write        0       0  strict
/dev/vg00/lvol5                vg00         available,syncd   10      read,write        0       0  strict
/dev/vg00/lvol6                vg00         available,syncd   2       read,write        0       0  strict
/dev/vg00/lvol7                vg00         available,syncd   8       read,write        0       0  strict
/dev/vg00/lvol8                vg00         available,syncd   10      read,write        0       0  strict
/dev/vg00/lvol9                vg00         available,syncd   20      read,write        0       0  strict
/dev/vg00/lvol10               vg00         available,syncd   1       read,write        0       0  strict
/dev/vg00/lvperf               vg00         available,syncd   11      read,write        0       0  strict
/dev/vgswap/lvswap             vgswap       available,syncd   20      read,write        0       0  strict,contiguous
/dev/vglocal/lvusrsap          vglocal      available,syncd   10      read,write        0       0  strict
/dev/vglocal/lvusrsapAA5       vglocal      available,syncd   10      read,write        0       0  strict
/dev/vglocal/lvoracle          vglocal      available,syncd   50      read,write        0       0  strict
/dev/vgdbAA5/lvsapmnt          vgdbAA5      available,syncd   40      read,write        0       0  strict
/dev/vgdbAA5/lvusrsaptrans     vgdbAA5      available,syncd   40      read,write        0       0  strict
/dev/vgdbAA5/lvoraclehome      vgdbAA5      available,syncd   10      read,write        0       0  strict
/dev/vgdbAA5/lv11204           vgdbAA5      available,syncd   20      read,write        0       0  strict
/dev/vgdbAA5/lvsapreorg        vgdbAA5      available,syncd   2       read,write        0       0  strict
/dev/vgdbAA5/lvoriglogA        vgdbAA5      available,syncd   2       read,write        0       0  strict
…

Leave a comment