rageek

A place for Unix Thoughts and Ideas

Category Archives: HP-UX

Turn on Locate LED for SAS Drive on HP-UX

Here is the process for Turning on the locate LED for a Drive on HP-UX

On my server EMS has indicated that drive 0/4/1/0.0.0.3.0 is experiencing errors.
I’m going to turn on the LED so I can easily locate it in my datacenter

root@testserver # sasmgr get_info -D /dev/sasd0 -v -q lun=all -q lun_locate
LUN LUN HW Path Enc Bay Locate LED
=== =========== === === ==========
/dev/rdsk/c1t0d0 0/4/1/0.0.0.0.0 1 5 OFF
/dev/rdsk/c1t1d0 0/4/1/0.0.0.1.0 1 6 OFF
/dev/rdsk/c1t2d0 0/4/1/0.0.0.2.0 1 7 OFF
/dev/rdsk/c1t3d0 0/4/1/0.0.0.3.0 1 8 OFF

RAID VOL ID is 1 :
LUN LUN HW Path
=== ===========
/dev/rdsk/c1t6d0 0/4/1/0.0.0.6.0

Physical disks in volume are :
Enc Bay Locate LED VendorID ProductID Revision
=== === ========== ======== ========= ========
1 4 OFF HP EG0146FARTR HPD5
1 1 OFF HP EG0146FARTR HPD5

root@testserver # sasmgr set_attr -D /dev/sasd0 -q lun=/dev/rdsk/c1t3d0 -q locate_led=on
Locate LED set to ON.

root@testserver # sasmgr get_info -D /dev/sasd0 -v -q lun=all -q lun_locate
LUN LUN HW Path Enc Bay Locate LED
=== =========== === === ==========
/dev/rdsk/c1t0d0 0/4/1/0.0.0.0.0 1 5 OFF
/dev/rdsk/c1t1d0 0/4/1/0.0.0.1.0 1 6 OFF
/dev/rdsk/c1t2d0 0/4/1/0.0.0.2.0 1 7 OFF
/dev/rdsk/c1t3d0 0/4/1/0.0.0.3.0 1 8 ON

RAID VOL ID is 1 :
LUN LUN HW Path
=== ===========
/dev/rdsk/c1t6d0 0/4/1/0.0.0.6.0

Physical disks in volume are :
Enc Bay Locate LED VendorID ProductID Revision
=== === ========== ======== ========= ========
1 4 OFF HP EG0146FARTR HPD5
1 1 OFF HP EG0146FARTR HPD5

To turn off, run the following:
root@testserver # sasmgr set_attr -D /dev/sasd0 -q lun=/dev/rdsk/c1t3d0 -q locate_led=off
Locate LED set to OFF.

Advertisements

HP-UX Disk Device Name Tricks and Info Gathering

Coming from the Solaris world, the old style disk naming convention used in HP-UX v1 and v2 can be confusing.

Here are some quick commands to assist in the task of matching devices to LUN numbers, and general information gathering in HP-UX

Show Volume groups and disks
for i in `vgdisplay 2>1 | grep “VG Name” | awk ‘{print $3}’ | grep -v ‘^vg’ | cut -d/ -f3`; do
printf “Group $i\n”
vgdisplay -v $i | egrep “PV Name|Free PE”
done

List
Group vg00
Free PE 2665
PV Name /dev/dsk/c0t6d0s2
Free PE 2665
Group vg10
Free PE 1640
PV Name /dev/dsk/c2t1d7
PV Name /dev/dsk/c5t1d7 Alternate Link
Free PE 0
PV Name /dev/dsk/c2t2d0
PV Name /dev/dsk/c5t2d0 Alternate Link
Free PE 41
PV Name /dev/dsk/c2t2d1
PV Name /dev/dsk/c5t2d1 Alternate Link
Free PE 1599

List Volume Groups
vgdisplay 2>1 | grep “VG Name” | awk ‘{print $3}’ | grep -v ‘^vg’ | cut -d/ -f3

List Fibre adapter paths
ioscan -kfC fc | awk ‘{ print $3}’ | egrep -v ‘H\/W|^$’
0/3/1/0/4/0
0/3/1/0/4/1
0/7/1/0/4/0
0/7/1/0/4/1

Read more of this post

Mapping SAS device names to bay location on HP Integrity Servers

The mapping between the bay numbers on the HP-UX Integrity servers are not very straight forward and if you make a mistake, you could loose critical data.

You can use the sasmgr command to get the information.

Here are 2 examples:

#sasmgr get_info -D /dev/sasd0 -q raid
Thu May  6 11:28:05 2010
———- PHYSICAL DRIVES ———-
LUN dsf              SAS Address          Enclosure    Bay      Size(MB)
/dev/rdsk/c0t0d0     0x5000c5000c9957b5     1            5      140014
/dev/rdsk/c0t3d0     0x5000c5000c987dfd     1            8      140014
/dev/rdsk/c0t4d0     0x5000c50007f34c91     1            1      140014
/dev/rdsk/c0t5d0     0x5000c5000122012d     1            2      140014 

Read more of this post

Booting HP-UX Integrity server from ignite server on a different subnet without dhcp

Not sure if this is much of a secret, but it was elusive to the instructor of my HP-UX training class last spring.

On Integrity servers, you can boot via ignite to a server on a different subnet.
This also doesn’t need dhcp, which is handy.

The server is 10.10.10.22 and client is 10.10.20.20

from EFI Shell
Shell> dbprofile -dn ignite -sip 10.10.10.22 -cip 10.10.20.20 -gip 10.10.20.1 -m 255.255.255.0 -b “/opt/ignite/boot/nbp.efi”

Shell> lanboot select -dn ignite

HP-UX equivalent of LOFS

HP-UX doesn’t have a native tool for mounting image files like Solaris.

However, you can psuedo get the same functionality by creating a logicial volume, dd the image onto it and then mounting it

mkdir /isoimg
lvcreate -n ISOLV -L 3096 /dev/vg00
dd if=isoimage of=/dev/vg00/rISOLV bs=8192
mount -F cdfs -oro,rr /dev/vg00/ISOLV /isoimg

Just make sure that the logical volume is big enough to hold the entire image.

Printing out HBA and WWN information on HP-UX

Here is a quick way of printing out information on all the Fibre adapters in a HP-UX system

This one liner prints out the WWN of the HBA ports and the state

root@testserver # for i in `ioscan -fknC fc | grep ‘/dev/’`; do echo $i; fcmsutil $i;done | egrep ‘World|Hardware|/dev|Driver state’
/dev/fcd0
N_Port Node World Wide Name = 0x50014380033a1709
N_Port Port World Wide Name = 0x50014380033a1708
Switch Port World Wide Name = 0x2096000dec2e2ac0
Switch Node World Wide Name = 0x2016000dec22a641
Driver state = ONLINE
Hardware Path is = 0/3/1/0/4/0
/dev/fcd1
N_Port Node World Wide Name = 0x50014380033a170b
N_Port Port World Wide Name = 0x50014380033a170a
Switch Port World Wide Name = 0x0000000000000000
Switch Node World Wide Name = 0x0000000000000000
Driver state = AWAITING_LINK_UP
Hardware Path is = 0/3/1/0/4/1
/dev/fcd2
N_Port Node World Wide Name = 0x50014380033a1719
N_Port Port World Wide Name = 0x50014380033a1718
Switch Port World Wide Name = 0x2098000dec350940
Switch Node World Wide Name = 0x2015000dec217c81
Driver state = ONLINE
Hardware Path is = 0/7/1/0/4/0
/dev/fcd3
N_Port Node World Wide Name = 0x50014380033a171b
N_Port Port World Wide Name = 0x50014380033a171a
Switch Port World Wide Name = 0x0000000000000000
Switch Node World Wide Name = 0x0000000000000000
Driver state = AWAITING_LINK_UP
Hardware Path is = 0/7/1/0/4/1
Hardware Path is = 0/4/1/0

The following one liner will print out the same the WWN info of the HBA ports and adds any targets that it sees
Read more of this post

Displaying Progress of LVM sync / resync / resliver on HP-UX

When replacing disks (or sync’n mirrors for the first time) in LVM on HP-UX, there is no clear way of determining how far along in the process the system is.

In came up with a quick trick for calculating what percent of Logical extents are sync’d

Here is a nice one liner to display this. Just change the LV variable to point to the device file for the logical volume

LV=/dev/vg00/lvol5 ; echo `lvdisplay -v $LV | grep current | wc -l` `lvdisplay -v $LV | grep stale | wc -l` | awk ‘{printf ( “%3d percent Complete \n”, 100-$2/$1*100) }’

Alternatively, here is a for loop which will show the percent complete for any stale logical volume in the system.

for i in `vgdisplay -v 2>&1 | sed ‘/LV Name/N;s/\n/ /’ | grep “LV Name” | grep stale | awk ‘{print $3}’`;do
        printf “${i}:”; echo `lvdisplay -v $i | grep current | wc -l` `lvdisplay -v $i | grep stale | wc -l` | awk ‘{printf ( “%3d percent complete\n”, 100-$2/$1*100) }’
done

The output will look like:

/dev/vg00/lvol5: 70 percent complete