How to get the WWN of an HBA with no SO installed, using ignite's recovery shell (PA-RISC)

Hi, I needed to get the WWN of a couple of HBAs, but I had no SO installed. So i checked around on the internet and got and idea from a bill hassell post on the itrc forums.

This is a NPAR from a SD32000 pa-risc superdome, if you have the luck to be on itanium you can spare all this reading and get the info directly from the efi-shell, you have info on how to do it in this post:

http://www.hpuxtips.es/?q=node/55

We boot via lan from and ignite server, we go in to a recovery shell

HP-UX NETWORK SYSTEM RECOVERY
MAIN MENU
HP-UX NETWORK SYSTEM RECOVERY
MAIN MENU

s. Search for a file
b. Reboot
l. Load a file
r. Recover an unbootable HP-UX system
x. Exit to shell
This menu is for listing and loading the tools contained on the core media.
Once a tool is loaded, it may be run from the shell. Some tools require other
files to be present in order to successfully execute.

Type 'menu' to return to the menu environment.

We first load ioscan to checkou the HBAs we have installed in our server:

# loadfile /sbin/ioscan
# ioscan -fnkC fc
Class I H/W Path Driver S/W State H/W Type Description
===================================================================
fc 0 3/0/6/0/0 td CLAIMED INTERFACE HP Tachyon XL2 Fibre Channel Mass Storage Adapter
fc 1 3/0/14/0/0 td CLAIMED INTERFACE HP Tachyon XL2 Fibre Channel Mass Storage Adapter

There is no fcmsutil included in the recoverys shell software available:

# loadfile /usr/bin/fcmsutil
DEBUG: killing tftp pid: 135ERROR: File: /usr/bin/fcmsutil not found.
NOTE: Retrying loadfile command...

So what we are going to do, is tar fcmsutil(and its libs) and get it from the ignite server via tftp.

We first have to work on our ignite server:

we check out the shared librarys fcmsutil needs to work, and we will load them in our recovery shell.

root@ep:/> ldd /usr/bin/fcmsutil
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2

We also need to create a tar with the contents of the /opt/fcms dir, and copy them to the /var/opt/ignite dir:

root@epsilon:/opt/fcms> tar -cvf /var/opt/ignite/fcms.tar .
a ./lib/pa20_64/libhbaapihp.sl 99 blocks
a ./lib/libhbaapihp.sl 96 blocks
a ./include/snia_common.h 32 blocks
a ./bin/fcmsutil 128 blocks
a ./bin/tddiag 24 blocks
a ./bin/tdlist 9 blocks
a ./bin/tdutil 160 blocks
a ./config/A5158A 1 blocks
a ./config/A6684A 1 blocks
a ./config/A6685A 1 blocks
a ./config/A6795A 1 blocks
a ./config/vendor.conf 1 blocks
a ./tools/td.pl 14 blocks

We finished on the ignite server end, now all our work, in on the recovery shell of the npar where we wan't to get the WWN's of the HBA

First we load tar, the benefit of using the loadfile option from the recovery menu is that it also loads all the command dependencies:

# exit
Press to continue.
HP-UX NETWORK SYSTEM RECOVERY
MAIN MENU
s. Search for a file
b. Reboot
l. Load a file
r. Recover an unbootable HP-UX system
x. Exit to shell
This menu is for listing and loading the tools contained on the core media.
Once a tool is loaded, it may be run from the shell. Some tools require other
files to be present in order to successfully execute.
Select one of the above: l -> L for Load file
NOTE: Loading some files may require other files/libraries to be loaded.
If an attempt is made to load a file, and an error message is
encountered when the command is invoked, it may be useful to use
the chatr command (on a system that is up and running) to ensure that
dependencies are met. See chatr(1) for more details.
For some commands (vi, ftp, rcp), the dependent files will be
automatically loaded. For others, you need to load them manually.
If you specify a filename of "all" a list of all the files available
will be displayed.
Enter the filename(s) to load:
tar ----------> we load tar
******** THE REQUESTED FILE(S): ***********
./usr/bin/tar
Is the above load list correct? [y/(n)] y
********* downloading the files *******

We load both of the shared libs that the fcmsutil command uses:

# loadfile /usr/lib/libc.2
# ls -l /usr/lib/libc.2
-r-xr-xr-x 1 bin bin 1359872 Sep 14 2006 /usr/lib/libc.2
# loadfile /usr/lib/libdld.2

And finally we download the tar file we created of the fcmsutil commands:

# tftp 10.132.73.236
tftp> get /var/opt/ignite/fcms.tar
Received 311403 bytes in 0.4 seconds
tftp> quit
# ls
.sh_history core dev.old duped_root fcms.tar opt sbin tmp var
RAMFS2 dev disc etc lost+found opt.old stand usr
# mv fcms.tar /opt/fcms/
# cd /opt/fcms/
# tar -xvf fcms.tar
x ./lib/pa20_64/libhbaapihp.sl, 50368 bytes, 99 tape blocks
x ./lib/libhbaapihp.sl, 49152 bytes, 96 tape blocks
x ./include/snia_common.h, 16208 bytes, 32 tape blocks
x ./bin/fcmsutil, 65536 bytes, 128 tape blocks
x ./bin/tddiag, 12087 bytes, 24 tape blocks
x ./bin/tdlist, 4331 bytes, 9 tape blocks
x ./bin/tdutil, 81920 bytes, 160 tape blocks
x ./config/A5158A, 187 bytes, 1 tape blocks
x ./config/A6684A, 187 bytes, 1 tape blocks
x ./config/A6685A, 187 bytes, 1 tape blocks
x ./config/A6795A, 195 bytes, 1 tape blocks
x ./config/vendor.conf, 13 bytes, 1 tape blocks
x ./tools/td.pl, 6944 bytes, 14 tape blocks
# cd bin

Ok, so now we have a working binary of fcmstuil, the next problem we have to solve is creating devices files for the HBAs:

# ioscan -fnkC fc
Class I H/W Path Driver S/W State H/W Type Description
===================================================================
fc 0 3/0/6/0/0 td CLAIMED INTERFACE HP Tachyon XL2 Fibre Channel Mass Storage Adapter
fc 1 3/0/14/0/0 td CLAIMED INTERFACE HP Tachyon XL2 Fibre Channel Mass Storage Adapter

We use mknod to create the devices:

# mknod /dev/td0 c 49 0x000000
# mknod /dev/td1 c 49 0x010000
# ioscan -fnkC fc
Class I H/W Path Driver S/W State H/W Type Description
===================================================================
fc 0 3/0/6/0/0 td CLAIMED INTERFACE HP Tachyon XL2 Fibre Channel Mass Storage Adapter
/dev/td0
fc 1 3/0/14/0/0 td CLAIMED INTERFACE HP Tachyon XL2 Fibre Channel Mass Storage Adapter
/dev/td1

And after that we are ready to go, we can get the wwn of our HBAs:

# fcmsutil /dev/td1
Vendor ID is = 0x00103c
Device ID is = 0x001029
XL2 Chip Revision No is = 2.3
PCI Sub-system Vendor ID is = 0x00103c
PCI Sub-system ID is = 0x00128c
Previous Topology = UNINITIALIZED
Link Speed = UNINITIALIZED
Local N_Port_id is = 0x000000
Local Loop_id is = 126
N_Port Node World Wide Name = 0x50060b000011595b
N_Port Port World Wide Name = 0x50060b000011595a
Driver state = AWAITING_LINK_UP
Hardware Path is = 3/0/14/0/0
Number of Assisted IOs = 0
Number of Active Login Sessions = 0
Dino Present on Card = NO
Maximum Frame Size = 2048
Driver Version = @(#) libtd.a HP Fibre Channel Tachyon TL/TS/XL2 Driver B.11.11.12 (AR1204) /ux/kern/kisu/TL/src/common/wsio/td_glue.c: Oct 11 2004, 14:45:41
#