/tmp/nwmgr_apa.log is huge on HP-UX 11.31

Ever find /tmp/nwmgr_apa.log to be gigantic on an HP-UX 11.31 machine?

I’m guessing you have Auto Port Aggregation version B.11.31.30 installed.

# /usr/sbin/swlist -l bundle J4240AA
# Initializing...
# Contacting target "server"...
#
# Target:  server:/
#

  J4240AA       B.11.31.30     Auto-Port Aggregation Software

Upgrading to B.11.31.40 should fix this.

SSHing to other hosts in ‘while read’ loop

The while read construct relies on receiving a stream of data through stdin to work. Under normal circumstances ssh also requires access to stdin. This means that without special care a while read loop that contains a call to ssh will only execute once because on the first loop ssh will attach to and drain stdin. This can be demonstrated by:

# cat host_list.txt
server1
server2
server3

# while read RMTHOST; do ssh ${RMTHOST} 'hostname'; done < host_list.txt
server1

#

According to man 1 ssh, the -n flag will cause ssh to not try to read from stdin. This fixes the problem and allows ssh to be used within a while read loop.

# cat host_list.txt
server1
server2
server3

# while read RMTHOST; do ssh -n ${RMTHOST} 'hostname'; done < host_list.txt
server1
server2
server3

#

Using MirrorDisk/UX to mirror vg00 on an HP-UX 11.31 Itanium server

Where PRIMARY is the current OS disk and SECONDARY is the disk on which you want to create the mirror:

# idisk -Rw /dev/rdisk/SECONDARY

# echo "3" > /tmp/pdf
# echo "EFI $(diskinfo /dev/rdisk/PRIMARY_p1 | grep size | while read label size kbytes; do echo ${size}/1024 | bc; done)MB" >> /tmp/pdf
# echo "HPUX $(diskinfo /dev/rdisk/PRIMARY_p2 | grep size | while read label size kbytes; do echo ${size}/1024 | bc; done)MB" >> /tmp/pdf
# echo "HPSP $(diskinfo /dev/rdisk/PRIMARY_p3 | grep size | while read label size kbytes; do echo ${size}/1024 | bc; done)MB" >> /tmp/pdf

# idisk -f /tmp/pdf -w /dev/rdisk/SECONDARY
# idisk /dev/rdisk/SECONDARY

# ioscan; insf -e -C disk; ioscan -fnNC disk

# efi_fsinit -d /dev/rdisk/SECONDARY_p1
# pvcreate -B /dev/rdisk/SECONDARY_p2
# vgextend vg00 /dev/disk/SECONDARY_p2
# mkboot -e -l /dev/rdisk/SECONDARY

# efi_ls -d /dev/rdisk/PRIMARY_p1
# efi_ls -d /dev/rdisk/SECONDARY_p1

# lifls -l /dev/rdisk/PRIMARY_p2
# lifls -l /dev/rdisk/SECONDARY_p2

# mkboot -a "boot vmunix -lq" /dev/rdisk/PRIMARY
# mkboot -a "boot vmunix -lq" /dev/rdisk/SECONDARY

# efi_cp -d /dev/rdisk/PRIMARY_p1 -u /EFI/HPUX/AUTO /tmp/prim
# cat /tmp/prim

# efi_cp -d /dev/rdisk/SECONDARY_p1 -u /EFI/HPUX/AUTO /tmp/mir
# cat /tmp/mir

# for i in `pvdisplay -v /dev/disk/PRIMARY_p2 | grep 'current.*0000 $' | awk 'BEGIN{ ORS=" " }{ print $3 }'`; do echo lvextend -m 1 $i /dev/disk/SECONDARY_p2; done | sh -x

# lvlnboot -R /dev/vg00
# lvlnboot -v

# setboot -a SECONDARY_DISK_HW_PATH

# echo "1 /dev/disk/SECONDARY_p2" >> /stand/bootconf

# dd if=/dev/rdisk/PRIMARY_p3 of=/dev/rdisk/SECONDARY_p3 bs=1024k

Change Process List sorting in GlancePlus

The process list in glance is sorted by CPU usage by default. You can also sort by process name and memory usage (RSS). To do this, from the process list screen hit “o”. You will be presented with a prompt:

Go to 1) Process; 2) Transaction; 3) Thread option screen(1) :

Select 1.

You’ll now be taken to a screen that looks like this:

                      INTERESTING PROCESS THRESHOLD OPTIONS

Display processes with resource usage:              Current Thresholds:

      CPU Utilization             >                 (0.0                %      )
      Disk I/O Rate               >                 (1.0                IOs/sec)
      Resident Set Size           >                 (20                 Mbytes )
      Virtual Set Size            >                 (500                Mbytes )
      User name                   =                 (all                       )
      Program name                =                 (all                       )
      TTY path name               =                 (all                       )
      Use match logic (and/or)    :                 (or                        )
      Sort key (name/cpu/rss)     :                 (cpu                       )

      Glance started or last reset: 08/18/2011  12:54:21
      Current refresh interval        : 5 seconds

Move the cursor down to the “sort key” field and type the name of key by which you want to sort. In parenthesis to the right is the current value. You’ll be prompted:

Set your user defaults to these values  (y/n/c)?

Press “y”.

 

http://deryaoktay.wordpress.com/2011/02/07/how-to-sort-processes-by-rss-memory-utilization-in-glance-in-hpux/

Using Agile View in ioscan

With HP-UX 11.31 comes “agile” disk naming. Tips for using agile view in ioscan:

The -N flag turns on agile view

Before:

# ioscan -fnC disk | head -n 15
Class     I  H/W Path     Driver S/W State   H/W Type     Description
=====================================================================
disk      1  0/1/1/0.0.0.0.0                     sdisk   CLAIMED     DEVICE       HP      EH0146FARWD
                         /dev/dsk/c3t0d0     /dev/dsk/c3t0d0s2   /dev/rdsk/c3t0d0    /dev/rdsk/c3t0d0s2
                         /dev/dsk/c3t0d0s1   /dev/dsk/c3t0d0s3   /dev/rdsk/c3t0d0s1  /dev/rdsk/c3t0d0s3
disk      2  0/1/1/0.0.0.1.0                     sdisk   CLAIMED     DEVICE       HP      EH0146FARWD
                         /dev/dsk/c3t1d0     /dev/dsk/c3t1d0s2   /dev/rdsk/c3t1d0    /dev/rdsk/c3t1d0s2
                         /dev/dsk/c3t1d0s1   /dev/dsk/c3t1d0s3   /dev/rdsk/c3t1d0s1  /dev/rdsk/c3t1d0s3
disk      3  0/1/1/0.0.0.2.0                     sdisk   CLAIMED     DEVICE       HP      EH0146FARWD
                         /dev/dsk/c3t2d0     /dev/dsk/c3t2d0s2   /dev/rdsk/c3t2d0    /dev/rdsk/c3t2d0s2
                         /dev/dsk/c3t2d0s1   /dev/dsk/c3t2d0s3   /dev/rdsk/c3t2d0s1  /dev/rdsk/c3t2d0s3
disk     10  0/2/0/0/0/0/4/0/0/0.4.41.0.0.0.0    sdisk   CLAIMED     DEVICE       HP      OPEN-V
                         /dev/dsk/c6t0d0   /dev/rdsk/c6t0d0
disk     11  0/2/0/0/0/0/4/0/0/0.4.41.0.0.0.1    sdisk   CLAIMED     DEVICE       HP      OPEN-V
                         /dev/dsk/c6t0d1   /dev/rdsk/c6t0d1

After:

# ioscan -fnNC disk | head -n 15
Class     I  H/W Path  Driver S/W State   H/W Type     Description
===================================================================
disk      5  64000/0xfa00/0x0   esdisk   CLAIMED     DEVICE       HP      EH0146FARWD
                      /dev/disk/disk5      /dev/disk/disk5_p2   /dev/rdisk/disk5     /dev/rdisk/disk5_p2
                      /dev/disk/disk5_p1   /dev/disk/disk5_p3   /dev/rdisk/disk5_p1  /dev/rdisk/disk5_p3
disk      6  64000/0xfa00/0x1   esdisk   CLAIMED     DEVICE       HP      EH0146FARWD
                      /dev/disk/disk6      /dev/disk/disk6_p2   /dev/rdisk/disk6     /dev/rdisk/disk6_p2
                      /dev/disk/disk6_p1   /dev/disk/disk6_p3   /dev/rdisk/disk6_p1  /dev/rdisk/disk6_p3
disk      7  64000/0xfa00/0x2   esdisk   CLAIMED     DEVICE       HP      EH0146FARWD
                      /dev/disk/disk7      /dev/disk/disk7_p2   /dev/rdisk/disk7     /dev/rdisk/disk7_p2
                      /dev/disk/disk7_p1   /dev/disk/disk7_p3   /dev/rdisk/disk7_p1  /dev/rdisk/disk7_p3
disk      9  64000/0xfa00/0x4   esdisk   CLAIMED     DEVICE       Optiarc DVD RW AD-5590A
                      /dev/disk/disk9   /dev/rdisk/disk9
disk     68  64000/0xfa00/0xe   esdisk   CLAIMED     DEVICE       HP      OPEN-V
                      /dev/disk/disk68   /dev/rdisk/disk68

Use -m dsf to translate between old-school and agile device special files

Old to new:

# ioscan -m dsf /dev/dsk/c6t0d1
Persistent DSF           Legacy DSF(s)
========================================
/dev/disk/disk69         /dev/dsk/c6t0d1

New to old (a great way to list multiple paths!):

# ioscan -m dsf /dev/disk/disk69
Persistent DSF           Legacy DSF(s)
========================================
/dev/disk/disk69         /dev/dsk/c6t0d1
                         /dev/dsk/c10t0d1

Installing from a multi-platform depot to an alternate root on HP-UX

Some depots from HP (notably the Java packages from http://software.hp.com/) contain filesets for multiple OS versions or even processor architectures. Installing them normally works fine, as the appropriate filesets are automatically selected and the others ignored. However, problems can arise when installing to an alternate root directory. The key is to pull only the filesets you need from the supplied depot and create a custom depot.

For instance, suppose we have a depot with one bundle:

[0]testserver:/var/adm/crash> swlist -d -l bundle -s /var/adm/crash/jdk15_15021_pa.depot
# Initializing...
# Contacting target "testserver"...
#
# Target:  testserver:/var/adm/crash/jdk15_15021_pa.depot
#

  Java15JDK     1.5.0.21.00    Java 1.5 JDK for HP-UX

And that bundle has two products:

[0]testserver:/var/adm/crash> swlist -d -l product -s /var/adm/crash/jdk15_15021_pa.depot
# Initializing...
# Contacting target "testserver"...
#
# Target:  testserver:/var/adm/crash/jdk15_15021_pa.depot
#

  Jdk15         1.5.0.21.00    Java 1.5 JDK
  Jre15         1.5.0.21.00    Java 1.5 JRE

And those products are made up of filesets; some for HP-UX 11.11, some for HP-UX 11.23, and some for HP-UX 11.31:

[0]testserver:/var/adm/crash> swlist -d -a software_spec -l fileset -s /var/adm/crash/jdk15_15021_pa.depot
# Initializing...
# Contacting target "testserver"...
#
# Target:  testserver:/var/adm/crash/jdk15_15021_pa.depot
#

# Jdk15                 Jdk15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP
  Jdk15.JDK15           Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jdk15.JDK15           Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.23_PA
  Jdk15.JDK15           Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.31_PA
  Jdk15.JDK15-COM       Jdk15.JDK15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jdk15.JDK15-DEMO      Jdk15.JDK15-DEMO,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jdk15.JDK15-PA20      Jdk15.JDK15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jdk15.JDK15-PA20W     Jdk15.JDK15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
# Jre15                 Jre15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP
  Jre15.JRE15           Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jre15.JRE15           Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.23_PA
  Jre15.JRE15           Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.31_PA
  Jre15.JRE15-COM       Jre15.JRE15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jre15.JRE15-COM-DOC   Jre15.JRE15-COM-DOC,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jre15.JRE15-PA20      Jre15.JRE15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jre15.JRE15-PA20-HS   Jre15.JRE15-PA20-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jre15.JRE15-PA20W     Jre15.JRE15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Jre15.JRE15-PA20W-HS  Jre15.JRE15-PA20W-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64

(hint, check the “fa=” part of the line for the intended OS version. “fa” means fileset architecture.)

We can construct a swcopy command to select and copy only the filesets we need to a new depot. The easiest way I’ve found for the Java depots is to first select the JRE version we need and then the JDK version as such:

[0]testserver:/var/adm/crash> sudo swcopy -p -s /var/adm/crash/jdk15_15021_pa.depot \
Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64 \
Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64 \
@ /var/adm/crash/jdk15_15021_11.11

=======  01/26/11 10:56:33 CST  BEGIN swcopy SESSION (non-interactive)
         (jobid=testserver-0286)

       * Session started for user "root@testserver".

       * Beginning Selection
       * Target connection succeeded for
         "testserver:/var/adm/crash/jdk15_15021_11.11".
       * Source:                 /var/adm/crash/jdk15_15021_pa.depot
       * Targets:                testserver:/var/adm/crash/jdk15_15021_11.11
       * Software selections:
           + Java15JDK,r=1.5.0.21.00,a=HP-UX_B.11.00_32/64,v=HP
             Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jdk15.JDK15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jdk15.JDK15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jdk15.JDK15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-COM-DOC,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20W-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
       * A "+" indicates an automatic selection due to dependency or
         the automatic selection of a patch or reference bundle.
       * Selection succeeded.


       * Beginning Analysis
       * Session selections have been saved in the file
         "/home/kris/.sw/sessions/swcopy.last".
       * The analysis phase succeeded for
         "testserver:/var/adm/crash/jdk15_15021_11.11".
       * Analysis succeeded.


NOTE:    More information may be found in the agent logfile using the
         command "swjob -a log testserver-0286 @
         testserver:/var/adm/crash/jdk15_15021_11.11".

=======  01/26/11 10:56:37 CST  END swcopy SESSION (non-interactive)
         (jobid=testserver-0286)

As we can see, just by specifying those two filesets the rest of the ones needed due to dependencies were automatically selected. We can go ahead and rerun that without the -p (preview) flag to create the new depot that contains only filesets for HP-UX 11.11.

[0]testserver:/var/adm/crash> sudo swcopy -s /var/adm/crash/jdk15_15021_pa.depot \
Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64 \
Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64 \
@ /var/adm/crash/jdk15_15021_11.11

=======  01/26/11 11:06:53 CST  BEGIN swcopy SESSION (non-interactive)
         (jobid=testserver-0288)

       * Session started for user "root@testserver".

       * Beginning Selection
       * Target connection succeeded for
         "testserver:/var/adm/crash/jdk15_15021_11.11".
       * Source:                 /var/adm/crash/jdk15_15021_pa.depot
       * Targets:                testserver:/var/adm/crash/jdk15_15021_11.11
       * Software selections:
           + Java15JDK,r=1.5.0.21.00,a=HP-UX_B.11.00_32/64,v=HP
             Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jdk15.JDK15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jdk15.JDK15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jdk15.JDK15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-COM-DOC,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
           + Jre15.JRE15-PA20W-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
       * A "+" indicates an automatic selection due to dependency or
         the automatic selection of a patch or reference bundle.
       * Selection succeeded.


       * Beginning Analysis and Execution
       * Session selections have been saved in the file
         "/home/kris/.sw/sessions/swcopy.last".
       * The analysis phase succeeded for
         "testserver:/var/adm/crash/jdk15_15021_11.11".
       * The execution phase succeeded for
         "testserver:/var/adm/crash/jdk15_15021_11.11".
       * Analysis and Execution succeeded.


NOTE:    More information may be found in the agent logfile using the
         command "swjob -a log testserver-0288 @
         testserver:/var/adm/crash/jdk15_15021_11.11".

=======  01/26/11 11:07:13 CST  END swcopy SESSION (non-interactive)
         (jobid=testserver-0288)

[0]testserver:/var/adm/crash> swlist -d -l bundle -l product -l fileset -a software_spec -s /var/adm/crash/jdk15_15021_11.11
# Initializing...
# Contacting target "testserver"...
#
# Target:  testserver:/var/adm/crash/jdk15_15021_11.11
#

#
# Bundle(s):
#

# Java15JDK                             Java15JDK,r=1.5.0.21.00,a=HP-UX_B.11.00_32/64,v=HP
# Java15JDK.Jdk15                       Jdk15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP
  Java15JDK.Jdk15.JDK15                 Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jdk15.JDK15-COM             Jdk15.JDK15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jdk15.JDK15-PA20            Jdk15.JDK15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jdk15.JDK15-PA20W           Jdk15.JDK15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
# Java15JDK.Jre15                       Jre15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP
  Java15JDK.Jre15.JRE15                 Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jre15.JRE15-COM             Jre15.JRE15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jre15.JRE15-COM-DOC         Jre15.JRE15-COM-DOC,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jre15.JRE15-PA20            Jre15.JRE15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jre15.JRE15-PA20-HS         Jre15.JRE15-PA20-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jre15.JRE15-PA20W           Jre15.JRE15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
  Java15JDK.Jre15.JRE15-PA20W-HS        Jre15.JRE15-PA20W-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64

At this point installing from the new depot to the alternate root directory will work just fine.

[0]testserver:/var/adm/crash> sudo swinstall -x mount_all_filesystems=false \
-s /var/adm/crash/jdk15_15021_11.11 Jdk15 Jre15 \
@ /apps/java/java150/jdk150_21

=======  01/26/11 12:01:20 CST  BEGIN swinstall SESSION
         (non-interactive) (jobid=testserver-0290)

       * Session started for user "root@testserver".

       * Beginning Selection
       * "testserver:/apps/java/java150/jdk150_21":  This target does not
         exist and will be created.
       * Source connection succeeded for
         "testserver:/var/adm/crash/jdk15_15021_11.11".
       * Source:                 /var/adm/crash/jdk15_15021_11.11
       * Targets:                testserver:/apps/java/java150/jdk150_21
       * Software selections:
           + Java15JDK,r=1.5.0.21.00,a=HP-UX_B.11.00_32/64,v=HP
             Jdk15.JDK15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jdk15.JDK15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jdk15.JDK15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jdk15.JDK15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15-COM,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15-COM-DOC,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15-PA20,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15-PA20-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15-PA20W,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
             Jre15.JRE15-PA20W-HS,r=1.5.0.21.00,a=HP-UX_B.11.11_32/64,v=HP,fr=1.5.0.21.00,fa=HP-UX_B.11.11_32/64
       * A "+" indicates an automatic selection due to dependency or
         the automatic selection of a patch or reference bundle.
       * Selection succeeded.


       * Beginning Analysis and Execution
       * Session selections have been saved in the file
         "/home/kris/.sw/sessions/swinstall.last".
       * "testserver:/apps/java/java150/jdk150_21":  There will be no
         attempt to mount filesystems that appear in the filesystem
         table.
WARNING: "testserver:/apps/java/java150/jdk150_21":  1 postinstall or
         postremove scripts had warnings.
       * Analysis and Execution succeeded.


NOTE:    More information may be found in the agent logfile using the
         command "swjob -a log testserver-0290 @
         testserver:/apps/java/java150/jdk150_21".

=======  01/26/11 12:02:21 CST  END swinstall SESSION (non-interactive)
         (jobid=testserver-0290)

[0]testserver:/var/adm/crash> ll /apps/java/java150/jdk150_21
total 0
drwxr-xr-x   4 root       sys             96 Jan 26 12:01 .
drwxr-xr-x   6 root       sys             96 Jan 26 12:00 ..
dr-xr-xr-x   3 bin        bin             96 Jan 26 12:01 opt
drwxr-xr-x   3 root       sys             96 Jan 26 12:00 var

[0]testserver:/var/adm/crash> /apps/java/java150/jdk150_21/opt/java1.5/bin/java -version
java version "1.5.0.21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0.21-_09_nov_2010_08_03)
Java HotSpot(TM) Server VM (build 1.5.0.21 jinteg:11.09.10-10:26 PA2.0 (aCC_AP), mixed mode) 

Viewing Symmetrix FA port flags

# symcfg -sid 3288 list -FA 8C -P 0

Symmetrix ID: 000190103288

           S Y M M E T R I X    F I B R E   D I R E C T O R S

    Dir    Port  WWN               VCM      Volume Set   Pnt to Pnt
                                   Enabled  Addressing

    FA-8C   0    5006048AD52FBE07  Yes      No           Yes

where sid is the serial number of the array in question, FA is the FA, and P is the FA port.

Note, Volume Set Addressing should be on for FA ports used by HP-UX servers.

Decoding device names from vmunix errors in syslog

Your HP-UX server has a failed local drive.  Luckily you are using MirrorDisk/UX, so the problem is more annoying than anything.  You find the error because of entries like the following in syslog.log:

Jan 13 02:50:22 hostname vmunix: SCSI: Async write error -- dev: b 31 0x022000, errno: 126, resid: 8192,
Jan 13 02:50:22 hostname vmunix:   blkno: 45699672, sectno: 91399344, offset: 3846791168, bcount: 8192.
Jan 13 02:50:22 hostname vmunix:   blkno: 45699128, sectno: 91398256, offset: 3846234112, bcount: 8192.
Jan 13 02:50:22 hostname vmunix: SCSI: Read error -- dev: b 31 0x022000, errno: 126, resid: 1024,
Jan 13 02:50:22 hostname vmunix: SCSI: Async write error -- dev: b 31 0x022000, errno: 126, resid: 8192,
Jan 13 02:50:22 hostname vmunix:   blkno: 8, sectno: 16, offset: 8192, bcount: 1024.
Jan 13 02:50:22 hostname vmunix: LVM: VG 64 0x000000: PVLink 31 0x022000 Failed! The PV is not accessible.
Jan 13 02:50:22 hostname vmunix:
Jan 13 02:50:22 hostname vmunix: LVM: VG 64 0x000000: PVLink 31 0x022000 Recovered.
Jan 13 03:06:32 hostname vmunix: LVM: Failed to automatically resync PV 1f022000  error: 5
Jan 13 03:14:07 hostname vmunix: LVM: Failed to automatically resync PV 1f022000  error: 5
Jan 13 03:26:57 hostname vmunix: LVM: Failed to automatically resync PV 1f022000  error: 5
Jan 13 03:32:45 hostname vmunix: LVM: Failed to automatically resync PV 1f022000  error: 5
Jan 13 03:50:19 hostname vmunix: LVM: Failed to automatically resync PV 1f022000  error: 5
Jan 13 03:55:19 hostname vmunix: LVM: Failed to automatically resync PV 1f022000  error: 5
Jan 13 03:59:27 hostname vmunix: LVM: Failed to automatically resync PV 1f022000  error: 5

ioscan is showing all hard drives as claimed and vgdisplay -v is showing all PVs as available. How can you tell which of your drives is dieing?

The syslog errors above are identifying the device throwing the errors in terms of major and minor numbers. First let’s look at the SCSI errors:

SCSI: Async write error -- dev: b 31 0x022000

This is saying that the device in question is a block device (dev: b 31 0x022000), the major number is decimal 31 (dev: b 31 0x022000), and the minor number is hexadecimal 022000 (dev: b 31 0x022000). By greping a long directory listing of /dev/dsk for that minor number we find:

$ ll /dev/dsk | grep 022000
brw-r-----   1 bin        sys         31 0x022000 Feb  9  2003 c2t2d0

The erroring disk is c2t2d0.

The LVM errors are very similar. For example:

LVM: Failed to automatically resync PV 1f022000

The main difference here is that the major and minor numbers are squished together and the whole thing is shown in hexadecimal (1F in hex is 31 in dec).

 

Update – March 2, 2011 at 09:31:

The LVM errors also identify the affected volume group via major and minor number. For example:

LVM: VG 64 0x000000: PVLink 31 0x022000 Failed! The PV is not accessible.

In this error, 64 (VG 64 0x000000) is the major number for volume groups and 0x000000 (VG 64 0x000000) is the minor number for vg00.

VGIDs and PVIDs on HP-UX

Both VGIDs and PVIDs on HP-UX are a combination of two values: the CPU ID of the machine on which the VG or PV is created and the Unix timestamp at the time of creation.

VGIDs from VGs

To view the VGID of a VG, use vgexport with the “scanable” flag to create a map file for the VG. Inside the map file will be the VGID as one, big hex number:

Note: The man page vgexport(1M) calls the -s flag the “sharable” option. In my opinion, this is a confusing misnomer. I call it the “scanable” flag because all it does is put the VGID line at the top of the map file allowing vgimport to scan all of the PVs in order to determine which PVs belong to that VG. Without that VGID line in the map file and the “scanable” flag in vgimport, you must specify each PV manually. Obviously, being able to scan for all of the PVs in a VG during importation is nice when a VG can move between multiple machines, but it’s just as handy if the VG never leaves the machine on which it was created.

# vgexport -p -v -s -m vg170.map vg170
Beginning the export process on Volume Group "vg170".
vgexport: Volume group "vg170" is still active.
/dev/dsk/c15t5d7
/dev/dsk/c15t7d6
/dev/dsk/c15t7d7
/dev/dsk/c15t8d1
/dev/dsk/c16t0d4
/dev/dsk/c16t0d5
/dev/dsk/c16t0d6
/dev/dsk/c19t5d2
/dev/dsk/c19t5d3
/dev/dsk/c23t7d4
/dev/dsk/c24t7d4
/dev/dsk/c24t7d5
/dev/dsk/c24t7d6

# cat vg170.map
VGID 075354214cf400f2
1 depot

The first 8 characters are the CPU ID and the last 8 are the timestamp. To check the CPU ID just convert from hex to decimal. The CPU ID of a machine can be obtained with uname -i.

# echo "0X07535421=D" | adb
                122901537

# uname -i
122901537

As we can see here, this VG was created on this computer.

Seeing the creation date is very similar.

# echo "0X4cf400f2=Y" | adb
                2010 Nov 29 13:37:22

VGIDs and PVIDs from disk headers

The headers of each LVM-controlled disk contain both the VGID of the VG the disk belongs to, as well as a unique PVID. There are a few ways to format the VGID, depending on what you are trying to do.

To get the VGID off of a disk in hex (maybe to compare with a VG map file):

# echo 0d8208?XX | adb /dev/dsk/c19t5d3
2010:           7535421         4CF400F2

To get the VGID off of a disk in decimal (maybe to compare CPU ID):

# echo 0d8208?UU | adb /dev/dsk/c19t5d3
2010:           122901537       1291059442

To get the date in human-readable format:

# echo 0d8208?UY | adb /dev/dsk/c19t5d3
2010:           122901537       2010 Nov 29 13:37:22

Viewing the PVID is very similar, we just have to look at a slightly different offset:

# echo "0d8200?UY" | adb /dev/dsk/c19t5d3
2008:           122901537       2010 Nov 29 13:53:31

Source

I got this information from the HP ITRC forums.

Pulling LUNs from an HP-UX server

Removing LUNs from a server will cause NO_HW entries in ioscan output and may make EMS complain regularly about not being able to access something it had been able to access previously. There are two ways to clean this up.

  1. Reboot
  2. # shutdown -r now

  3. Manual cleanup
  4. # /etc/opt/resmon/lbin/monconfig

    Option “K” to stop monitoring

    # /sbin/init.d/diagnostic stop
    # rmsf -H <hardware path to missing LUN> -v

    Repeat rmsf until all missing LUNs are removed

    # rm /var/stm/data/psm_data
    # /sbin/init.d/diagnostic start
    # /etc/opt/resmon/lbin/monconfig

    Option “E” to start monitoring