Author: Emerson .

Querying HBA information under Linux

To check the HBA cards installed on your system, check lspci

root@linux:~ # lspci | grep -i fibre
13:01.0 Fibre Channel: Emulex Corporation Thor-X LightPulse Fibre Channel Host Adapter (rev 01)
13:02.0 Fibre Channel: Emulex Corporation Thor-X LightPulse Fibre Channel Host Adapter (rev 01)

You can query various information using systool

root@linux:~ # systool -av -c fc_host
Class = “fc_host”

Class Device = “host0”
Class Device path = “/sys/class/fc_host/host0”
active_fc4s = “0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ”
fabric_name = “0x100000051eecc200”
issue_lip =
maxframe_size = “2048 bytes”
node_name = “0x20000000c95e5ee1”
port_id = “0x0ab040”
port_name = “0x10000000c95e5ee1”
port_state = “Online”
port_type = “NPort (fabric via point-to-point)”
speed = “2 Gbit”
supported_classes = “Class 3”
supported_fc4s = “0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ”
supported_speeds = “1 Gbit, 2 Gbit”
tgtid_bind_type = “wwpn (World Wide Port Name)”
uevent =

Device = “host0”
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:12:00.0/0000:13:01.0/host0”
uevent =

Class Device = “host1”
Class Device path = “/sys/class/fc_host/host1”
active_fc4s = “0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ”
fabric_name = “0x100000051ef63200”
issue_lip =
maxframe_size = “2048 bytes”
node_name = “0x20000000c95e93bd”
port_id = “0x14b040”
port_name = “0x10000000c95e93bd”
port_state = “Online”
port_type = “NPort (fabric via point-to-point)”
speed = “2 Gbit”
supported_classes = “Class 3”
supported_fc4s = “0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ”
supported_speeds = “1 Gbit, 2 Gbit”
tgtid_bind_type = “wwpn (World Wide Port Name)”
uevent =

Device = “host1”
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:12:00.0/0000:13:02.0/host1”
uevent =

Checking numerous status. Example shown below is a different server

root@linux:~ # systool -c scsi_host -v -d host1
Class = “scsi_host”

Class Device = “host1”
Class Device path = “/sys/class/scsi_host/host1”
84xx_fw_version = “”
beacon = “Disabled”
cmd_per_lun = “3”
driver_version = “8.03.07.15.05.09-k”
eh_deadline = “0”
fabric_param = “1280”
flash_block_size = “0x8000”
fw_state = “0x3 0x2a8c 0x9100 0x5 0x0”
fw_version = “5.06.03 (9496)”
host_busy = “0”
isp_id = “0000 0000 0000 0000”
isp_name = “ISP2432”
max_npiv_vports = “127”
model_desc = “PCI-Express Dual Channel 4Gb Fibre Channel HBA”
model_name = “QLE2462”
mpi_version = “”
npiv_vports_inuse = “0”
optrom_bios_version = “1.08”
optrom_efi_version = “1.02”
optrom_fcode_version= “1.13”
optrom_fw_version = “4.00.12 2”
pci_info = “PCIe (2.5Gb/s x4)”
phy_version = “”
proc_name = “”
scan =
serial_num = “”
sg_tablesize = “255”
state = “Link Up – F_Port”
total_isp_aborts = “0”
uevent =
unchecked_isa_dma = “0”
unique_id = “0”
vlan_id = “”
vn_port_mac_address = “”
vport_create =
vport_delete =
zio_timer = “200 us”
zio = “Disabled”

Device = “host1”
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:17:00.0/0000:18:02.0/0000:22:00.0/host1”
fw_dump =
nvram = “ISP ”
optrom_ctl =
optrom =
reset =
sfp = “”
uevent =
vpd = “▒.”

Or you can query each attribute issuing cat /sys/class/scsi_host/hostX/<attribute>

Model name

root@linux:~ # cat /sys/class/scsi_host/host0/model*name
LP10000

Model description

root@linux:~ # cat /sys/class/scsi_host/host0/model*desc
Emulex LP10000 2Gb PCI-X Fibre Channel Adapter

Check this link to see how to upgrade a Fibre Channel HBA on HP Proliant – Upgrading firmware on an Emulex Zephyr-X LightPulse Fibre Channel HBA

HBA ROM version

root@linux:~ # cat /sys/class/scsi_host/host0/opt*rom*
5.01a5

Firmware revision

root@linux:~ # cat /sys/class/scsi_host/host0/fwrev
1.91A1 (T2D1.91A1), sli-2

root@linux:~ # cat /sys/class/scsi_host/host0/fw_version
5.03.01 (496)

Driver version

root@linux:~ # lspci -v | grep -i fibre -A11 | grep driver
Kernel driver in use: lpfc
Kernel driver in use: lpfc

root@linux:~ # modinfo lpfc | egrep ‘filename|version|author|description’
filename: /lib/modules/2.6.18-238.9.1.el5/kernel/drivers/scsi/lpfc/lpfc.ko
version: 0:8.2.0.87.1p
author: Emulex Corporation – tech.support@emulex.com
description: Emulex LightPulse Fibre Channel SCSI driver 8.2.0.87.1p

View script to query HBA information

Error updating RHEL package: Cannot retrieve repository metadata for repository: rhel-x86_64-server-5

I made a local repository on my network to avoid updating the package through the internet. But my system was giving me the following error

root@linux:~ # yum update nscd
Loaded plugins: rhnplugin, security
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-x86_64-server-5. Please verify its path and try again

To solve this problem, I disabled the rhnplugin

root@linux:~ # vi /etc/yum/pluginconf.d/rhnplugin.conf
[main]
enabled = 0
gpgcheck = 1

# You can specify options per channel, e.g.:
#
#[rhel-i386-server-5]
#enabled = 1
#
#[some-unsigned-custom-channel]
#gpgcheck = 0

cannot fork [Resource temporarily unavailable]

Tried to login to a Linux server but gave the error cannot fork [Resource temporarily unavailable]

ssh oracle@linux
/etc/profile[62]: .[5]: .: line 46: cannot fork [Resource temporarily unavailable]

Saw how many processes oracle user has

root@linux:~ # ps -ef | grep oracle | wc -l
2038

Then increased the number of processes

root@linux:~ # vi /etc/security/limits.conf
#oracle soft nproc 2048
oracle soft nproc 4096

Configuring HP-UX routes

Add or delete a route to a specific host:

root@hp-ux:/ # route add host 192.168.1.1 192.168.0.1 1

root@hp-ux:/ # route delete host 192.168.1.1 192.168.0.1

Add or delete a route to a network

root@hp-ux:/ # route add net 192.168.1.0 netmask 255.255.255.0 192.168.1.1 1

root@hp-ux:/ # route delete net 192.168.1.0 netmask 255.255.255.0 192.168.1.1

Add or delete a default route

root@hp-ux:/ # route add default 192.168.0.1 1

root@hp-ux:/ # route delete default 192.168.0.1

Flush all gateway entries from the routing table

root@hp-ux:/ # route -f

Saving the IP Routing Configuration

root@hp-ux:/ # vi /etc/rc.config.d/netconf
ROUTE_DESTINATION[0]=”net 129.1.0.0″
ROUTE_MASK[0]=”255.255.0.0″
ROUTE_GATEWAY[0]=”128.1.0.1″
ROUTE_COUNT[0]=”1″
ROUTE_ARGS[0]=””
ROUTE_SOURCE[0]=””
ROUTE_DESTINATION[1]=”default”
ROUTE_MASK[1]=””
ROUTE_GATEWAY[1]=”128.1.0.1″
ROUTE_COUNT[1]=”1″
ROUTE_ARGS[1]=””
ROUTE_SOURCE[1]=””

Update HP iLO Firmware on HP Proliant

To update the HP iLO, go to this page http://h18013.www1.hp.com/products/servers/management/iloadv3/index.html and under the section Products Firmware and Tools, click on the version that your server has and download the firmware.

Download the file according to your Operating System. My OS is a Red Hat Enterprise Linux 5, so I downloaded the file and then copied to the server.

iLO 1 v.1.96 – CP023365.scexe
iLO 2 v.2.29 – CP027871.scexe
iLO 3 v.1.20 – CP014002.scexe
You first need to have at least iLO 3 version 1.20 to update to later versions
iLO 3 v.1.85 – CP026424.scexe
iLO 4 v.2.30 – CP026236.scexe

To update, you run the file as shown below

root@linux:/tmp # bash ./CP018561.scexe

FLASH_iLO3 v1.09 for Linux (Jan 23 2013)
(C) Copyright 2002-2013 Hewlett-Packard Development Company, L.P.
Firmware image: ilo3_155.bin
Current iLO 3 firmware version 1.26; Serial number ILOBRC14004X5

Component XML file: CP018561.xml
CP018561.xml reports firmware version 1.55
This operation will update the firmware on the
iLO 3 in this server with version 1.55.
Continue (y/N)?y
Current firmware is 1.26 (Aug 26 2011 )
Firmware image is 0x801664(8394340) bytes
Committing to flash part…
******** DO NOT INTERRUPT! ********
Flashing is underway… 67 percent programmed. –

After the flashing finishes, wait a few minutes for iLO to restart

******** DO NOT INTERRUPT! ********
Flashing completed.
Attempting to reset device.
Succeeded.
***** iLO 3 reboot in progress (may take up to 60 seconds.)
***** Please ignore console messages, if any.
iLO 3 reboot completed.

If the update fails, follow the instructions on this page Error when updating iLO2 in HP Proliant to unpack the files in the self-executable and try to update the iLO using the web interface.

HP-UX: root password expired in a trusted system

There is an HP-UX system that had the root password expired

user@linux:~ $ ssh root@hp-ux
Last successful login for root: Mon Apr 1 13:01:33 BRA3BDT 2013
Last unsuccessful login for root: Mon Apr 1 13:02:14 BRA3BDT 2013
Your password has expired.
Last login: Mon Apr 1 13:01:33 2013 from 172.16.4.198
Changing password for root
Old password:
Sorry.

I was unable to change the password since it is not known

root@hp-ux:/root # passwd root
Changing password for root
Old password:
Sorry.

Since there is no /etc/shadow file because this is a trusted system, to delete the root password you go to the /tcb/files/auth/r/root and delete the password from the :u_pwd attribute

root@hp-ux:/tcb/files/auth/r # cat root
root:u_name=root:u_id#0:\
:u_pwd=2576d348b7120d068cf812db81d2a414:\
:u_bootauth:u_auditid#0:\
:u_auditflag#1:\
:u_succhg#1348864982:u_unsucchg#1364832324:u_pswduser=root:u_suclog#1364832138:\
:u_unsuclog#1364832144:u_numunsuclog#1:u_maxtries#0:u_lock@:\
:chkent:

Then you should not have a problem to change the password

root@hp-ux:/tcb/files/auth/r # passwd root
Changing password for root
Last successful password change for root: Fri Sep 28 17:43:02 2012
Last unsuccessful password change for root: Mon Apr 1 13:05:24 2013

Do you want (choose one letter only):
pronounceable passwords generated for you (g)
a string of letters generated (l) ?
to pick your passwords (p) ?

Enter choice here: p
New password:
Re-enter new password:
Passwd successfully changed

AIX – Mirroring a logical volume

Check the logical volume to be mirrored

root@aix:/ # lsvg -l datavg | grep mirroring
mirroring jfs2 64 64 7 open/syncd /data

Run the command below to make two copies of this logical volume

root@aix:/ # mklvcopy mirroring 2

Then start syncing the volume group

root@aix:/ # nohup syncvg -v datavg &

To verify that the volume is mirrored, verify if the column PPs is the double of the column LPs

root@aix:/ # lsvg -l datavg | grep mirroring
mirroring jfs2 64 128 14 open/stale /data

HP-UX – Import a volume group

To import a volume group in HP-UX you need to specify the disks that are part of this volume group. In the example below, the volume group only has one disk

root@hp-ux:/# vgimport /dev/vgomni /dev/disk/disk22
vgimport: Volume group “/dev/vgomni” has been successfully created.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

After activacting the volume groups

root@hp-ux:/# vgchange -a y
Volume group “/dev/vg00” is already active on this system.
Activated volume group.
Volume group “/dev/vgomni” has been successfully changed.

And I took a backup of the volume group configuration

root@hp-ux:/# vgcfgbackup /dev/vgomni
Volume Group configuration for /dev/vgomni has been saved in /etc/lvmconf/vgomni.conf

HP-UX vgdisplay: /etc/lvmtab: No such file or directory

root@hp-ux:/ # vgdisplay
vgdisplay: /etc/lvmtab: No such file or directory
vgdisplay: No volume group name could be read from “/etc/lvmtab”.

To recreate the /etc/lvmtab, run vgscan -a to make it rescan all the multipathed physical volumes

root@hp-ux:/ # vgscan -a
Creating “/etc/lvmtab”.

Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c77t0d1
/dev/dsk/c79t0d1
/dev/dsk/c81t0d1
/dev/dsk/c83t0d1
/dev/dsk/c85t0d1
/dev/dsk/c89t0d1
/dev/dsk/c91t0d1
/dev/dsk/c87t0d1

The Volume Group /dev/vg01 was not matched with any Physical Volumes.
The Volume Group /dev/vgomni was not matched with any Physical Volumes.
*** LVMTAB has been created successfully.
*** If PV links are configured in the system.
*** Do the following to resync information on disk.
*** #1. vgchange -a y
*** #2. lvlnboot -R

Then depending on your system you may need to run vgimport against some disks in your server

HP Multipath Device Mapper for Linux Software

Previously HP had a kit to enable the native open-source multipathing solution called Device Mapper Multipath Enablement Kit for HP StorageWorks Disk Arrays

Nowadays HP recommends to read a document called Native Linux Device-Mapper Multipath for HP StorageWorks Disk Arrays reference guide to enable the native open-source multipathing solution.