lqueryvg (useful undocumented LVM/VGDA query)

Lqueryvg bypasses LVM altogether and reads the VGDA off of any disk that is a member of a volume group. Sometimes when LVM and VGDA get out of sync with each other, the volume group information here can be a great help.  Think of this information as what great read from the disk when you do an importvg.

 

# lqueryvg -Atp hdisk0
Max LVs: 256
PP Size: 28
Free PPs: 959
LV count: 4
PV count: 2
Total VGDAs: 3
Conc Allowed: 0
MAX PPs per PV 1016
MAX PVs: 32
Quorum (disk): 0
Quorum (dd): 0
Auto Varyon ?: 0
Conc Autovaryo 0
Varied on Conc 0
Logical:    00c1b3da00004c0000000112982a7298.1 loglv02 1
                00c1b3da00004c0000000112982a7298.3 fslv00 3
                00c1b3da00004c0000000112982a7298.4 fslv02 3
                00c1b3da00004c0000000112982a7298.5 fslv04 3
Physical:  00cdeaeadfcd0ebc 2 0
                00031691bced4a4e 1 0
Total PPs:    1617
LTG size:     128
HOT SPARE:  0
AUTO SYNC: 0
VG PERMISSION: 0
SNAPSHOT VG: 0
IS_PRIMARY VG: 0
PSNFSTPP: 4352
VARYON MODE: 0
VG Type: 0
Max PPs: 32512
#

Two scripts that allow you to mail errpts to yourself

/buxs/bin> more errpt_odmadd
#!/bin/ksh

grep “^##” $0 | sed ‘s/^##//g’ > /tmp/$$.odmadd

odmdelete -o errnotify -q “en_name = syslog”
odmadd /tmp/$$.odmadd
rm /tmp/$$.odmadd

##errnotify:
##  en_pid = 0
##  en_name = “syslog”
##  en_persistenceflg = 1
##  en_label = “”
##  en_crcid = 0
##  en_class = “”
##  en_type = “”
##  en_alertflg = “”
##  en_resource = “”
##  en_rtype = “”
##  en_rclass = “”
##  en_method = “/admin/bin/errnotify $1”

/admin/bin> more errnotify
#!/bin/ksh

O=/admin/bin/errnotify.txt

errpt -a -l $1 > $O

egrep “LABEL|Class|Type” $O | cut -c 7- | xargs -n3 |  read A B C

chmod 755 $O

dt=`date +”%m %e %Y %T”`

echo $A $B $C $dt >> /admin/bin/errcount.txt

chmod 755 /admin/bin/errcount.txt

chown root.buxs /admin/bin/errcount.txt

mail -s “`hostname`: errpt $A $C $B”  YOUR_EMAIL_HERE< $O

Errpt message hack / Broadcom Error

Many months ago I began getting Duplicate Arp Errors in my error report.  The network guys tried to track it down for months (or for months they periodically tried to track it down).  We finally figured out that it was a bug with Broadcom Windows Teaming.  It is explained in this website. ( SurfControl Approved CopyIn the meantime, I wrote this action that immediately deletes the message from the error report in AIX when it shows up, because I was getting one each minute:

errnotify:      
               en_name = "BogusARP"      
               en_persistenceflg = 1      
               en_label = "AIXIF_ARP_DUP_ADDR"      
               en_class = "S"      
               en_type = "PERM"      
               en_method = "/usr/bin/errclear -l $1 0"

Instead of doing the above hack, you can also simply turn error reporting off for this message:

errupdate =FE2DEE00: Log=False Report=False

To check what you have turned off:

errpt -t -F Report=0 errpt -t -F Log=0

 
 
 

 

dummydisk

In AIX, you can create devices by simply running the ‘cfgmgr’ command which walks the bus or virtual bus and starts defining a new structure of adapters and disks, or tapes or whatever. And sometimes it is really advantageous to have the numbering of the devices skip a little bit, to sync with another system that sees the same disks. ‘dummydisk’ is a small self-referencing command that creates bogus ODM entries that look however you want them. Then you simply run ‘cfgmgr’ and devices that you want to skip will appear taken. So far I don’t have a version or an installp package and they can only be removed with the dummydev command, but that is what version 0.1 is all about:


#!/bin/ksh

###############################################################
# Title         :  dummydisk - Creates a placeholder disk
# Author        :  John Rigler
# Date          :  7/31/2008
# Requires      :  ksh
# Web           :  http://deadlycoffee.com/?p=12
###############################################################
# This script creates phantom disks that don't actually do
# anything but makes it easier to line up disk names on
# different servers.  Just create dummy disk up to the actual
# disk that you need, then when you run cfgmgr, your new disk
# or disks will be created with the correct id.  It is possible
# to create your disks with mkdev, but who the heck does that?
# You can't yet delete these disks with rmdev because the config
# method is wrong. Once I get some time, I will add entries to
# the Pd tables to make rmdev -dl work.
################################################################



case $1 in

        -a )  grep "^##S" $0 | cut -c 4- | sed "s/REPLACENAME/$2/g" | odmadd ;;
        -d )  odmdelete -o CuDv -q "name = $2" ;
              odmdelete -o CuAt -q "name = $2" ;;
         * )  echo;
              echo "To add a dummy device:              $0 -a devicename";
              echo "To delete a dummy devices:  $0 -d devicename"  ;
              echo ;;

esac

##SCuDv:
##S        name = "REPLACENAME"
##S        status = 1
##S        chgstatus = 2
##S        ddins = "dummydev"
##S        location = "FF-FF-FF-FF,F"
##S        parent = "scsi2"
##S        connwhere = "FF,F"
##S        PdDvLn = "disk/scsi/scsd"
##S
##SCuAt:
##S        name = "REPLACENAME"
##S        attribute = "unique_id"
##S        value = "deadlyc0ffee000000000000"
##S        type = "R"
##S        generic = ""
##S        rep = "n"
##S        nls_index = 0
##S
##SCuAt:
##S        name = "REPLACENAME"
##S        attribute = "pvid"
##S        value = "000dummydisk0000            "
##S        type = "R"
##S        generic = "D"
##S        rep = "s"
##S        nls_index = 11
##S
##SCuDvDr:
##S        resource = "devno"
##S        value1 = "99"
##S        value2 = "0"
##S        value3 = "REPLACENAME"