SCLI Command And HBA link status check ?

How to check HBA card status or Link?

# grep -i "loop state" /proc/scsi/qla2xxx/"HBA adapter no"

O/P will be like,

[root@serverA qla2xxx]# grep -i "loop state" /proc/scsi/qla2xxx/5 
Host adapter:loop state = , flags = 0x45a03 
[root@serverA qla2xxx]# 


Use the systool command

#systool -c scsi_host -v | grep state

SCLI Command to manage HBA status:

You can use SCLI command to check the info about HBA card and also you can diagnose your HBA card on server. SCLI menu will be like below 

[root@serverA ~]# scli

Scanning QLogic FC HBA(s) and devices ...            /

        SANsurfer FC HBA CLI

        v1.06.16 Build 28

    Main Menu

    1:  Display System Information
    2:  Display HBA Settings
    3:  Display HBA Information
    4:  Display Device List
    5:  Display LUN List
    6:  Target Persistent Binding
    7:  Selective LUNs
    8:  Driver Settings
    9:  Flash Beacon
   10:  Diagnostics
   11:  Statistics
   12:  Help
   13:  Quit

        Enter Selection:

2. Display the current LUN count:

# scli -t

3. Send the rescan command and check the LUN count update:

# echo "- - -" > /sys/class/scsi_host/host2/scan
# scli –t

# echo “- - -“ > /sys/class/scsi_host/host3/scan
# scli –t

4. Display the LUN details:

# scli –l 0

# scli –l 1

How to reset HBA and How to find WWNN & WWPN

A. To get List of HBA card installed on server :

#lspci | grep -i fibre

B. To View used HBA ports on server:

#ls -lrt /sys/class/fc_transport/

drwxr-xr-x  2 root root 0 May 27 09:40 target7:0:2
drwxr-xr-x  2 root root 0 May 27 09:40 target7:0:1
drwxr-xr-x  2 root root 0 May 27 09:40 target7:0:0
drwxr-xr-x  2 root root 0 May 27 09:40 target5:0:2
drwxr-xr-x  2 root root 0 May 27 09:40 target5:0:1
drwxr-xr-x  2 root root 0 May 27 09:40 target5:0:0

From the above o/p we can confirm the HBA ports 7 and 5 used on this server.


# powermt display dev=all

---------------- Host ---------------   - Stor -   -- I/O Path -  -- Stats ---
###  HW Path                I/O Paths    Interf.   Mode    State  Q-IOs Errors
   7 lpfc                      sdai      SP B3     active  alive      0      0
   7 lpfc                      sdat      SP A2     active  alive      0      0
   5 lpfc                      sde       SP B2     active  alive      0      0
   5 lpfc                      sdp       SP A3     active  alive      0      0

From the above powermt output is showing the "HBA path" which is used to connect the storage disk. 7 & 5 used.

C. To find WWNN and WWPN number

#cd /sys/class/fc_host/host??

#cat port_name

#cat node_name

Method 2 :

#cat /sys/class/scsi_host/host??/device/fc_host:host??/port_name 

Method 3:

#cat /proc/scsi/adapter-type/host-number

adapter-type : May be qlaxxxx for QLogic adapters (or) lpfc for Emulex adapters

you will get  the port and node numbers like below:

SCSI Device Information:

Method 4: 

There is another method to find the hba wwn details by using the package called sysfutils

  #rpm -ivh libsysfs-2.1.0-6.1.el6.x86_64.rpm
  #rpm -ivh sysfsutils-2.1.0-6.1.el6.x86_64.rpm


  #yum install sysfsutils

  Then run the below command to get the WWNN and WWPN number

 #systool -c fc_host -v -d host0

D. How to reset HBA without reboot server

#echo > "0" /sys/class/scsi_host/host#/board_online

#echo > "1" /sys/class/scsi_host/host#/board_online

#echo > "- - -" /sys/class/scsi_host/host#/scan

If power path is used on server then run below command 

# powermt config

If multipath is used on server then run below command

# multipath -v2

How to create and Delete Symbolic link file?

Create a Symbolic link file :

#cd /tmp
#ln -s /etc/test.conf test
#ls -l test


lrwxrwxrwx 1 root root 16 2013-05-16 07:38 test -> /etc/test.conf

Now Delete a symobolic link:

#rm linkname  ( #rm test or #unlink test )


#unlink linkname

Manage HBA with one command manager utility - hpacmd

hbacmd - Utility is used to Manage the Emulex HBA card in linux server.

We can down load this utility from Emulex support site. This is coming with HBAnyware utility kit. Its called one command manager tool.

Installation steps:

1.Install the iocontrol module and then driver. And then reboot the server. ( This is prerequesite)


Extract the above files and run the installation scripts.

2. once server is up ,then install the Core kit file which contains one command manager


#tar -zxvf elxlinuxcorekit-4.0a38-

#rpm -ivh elxlinuxcorekit-4.0a38*.rpm

Now we can use the utility. Below commands will explain how to use this utility.

1.Help menu

$ /usr/sbin/hbanyware/hbacmd -h
Usage: hbacmd { h=IP Address or Hostname{:port} } 
Valid Commands:










2. List out HBA cards

$ /usr/sbin/hbanyware/hbacmd listhbas
Manageable HBA List

Port WWN   : 10:00:00:00:c9:49:28:42
Node WWN   : 20:00:00:00:c9:49:28:42
Fabric Name: 10:00:00:60:69:80:2d:ee
Flags      : 8000f980
Host Name  : server01
Mfg        : Emulex Corporation

Port WWN   : 10:00:00:00:c9:49:28:47
Node WWN   : 20:00:00:00:c9:49:28:47
Fabric Name: 10:00:00:60:69:80:0e:fc
Flags      : 8000f980
Host Name  : fraudmgmt01
Mfg        : Emulex Corporation

[ ..... ]

3.To view Performance metrics

#/usr/sbin/hbanyware/hbacmd PortStat 10:00:00:00:c9:49:28:47
Port Statistics for10:00:00:00:c9:49:28:47

Secs Since Last Reset : 21573
Exchange Count: 1308267
Responder Exchange Count: 363
TX Seq Count : 1315705
RX Seq Count : 6357365
TX Frame Count : 1336810
RX Frame Count : 161483066
TX Word Count : 31567104
RX Word Count : 3316320000
TX KB Count :123309
RX KB Count : 12954375

4.To view properties of HBA

$ /usr/sbin/hbanyware/hbacmd HBAAttrib 10:00:00:00:c9:49:28:47
HBA Attributes for 10:00:00:00:c9:49:28:47

Host Name      : server01
Manufacturer   : Emulex Corporation
Serial Number  : MS51403247
Model          : LP9802
Model Desc     : Emulex LightPulse LP9802 2 Gigabit PCI Fibre Channel Adapter
Node WWN       : 20 00 00 00 c9 49 28 47
Node Symname   : Emulex LP9802 FV1.91A1 DV6.02f
HW Version     : 2003806d
Opt ROM Version: 1.50a4
FW Version     : 1.91A1 (H2D1.91A1)
Vender Spec ID : 80F9
Number of Ports: 1
Driver Name    : lpfc
Device ID      : F980

5.To view port Attributes

#/usr/sbin/hbanyware/hbacmd PortAttrib 10:00:00:00:c9:49:28:47

Port Attributes for 10:00:00:00:c9:49:28:47

Node WWN            : 20 00 00 00 c9 49 28 47
Port WWN            : 10 00 00 00 c9 49 28 47
Port Symname        :
Port FCID           : 6D0900
Port Type           : Fabric
Port State          : Operational
Port Service Type   : 6
Port Supported FC4  : 00 00 01 20 00 00 00 01
                      00 00 00 00 00 00 00 00
                      00 00 00 00 00 00 00 00
                      00 00 00 00 00 00 00 00

6.Reset HBA card 

# /usr/sbin/hbanyware/hbacmd Reset 10:00:00:00:c9:49:2c:b4

Reset HBA 10:00:00:00:c9:49:2c:b4

7.Upgrade Firmware and Bios for HBA card

Upgrade firmware in HBA

# ./usr/sbin/hbanyware/hbacmd Download  “Port WWN no of HBA card”  /dir/ firmware file path  

( Need to run this command for all HBA cards on server)

BIOS Upgrade:

Bios also need to update using the same command 

#./usr/sbin/hbanyware/hbacmd Download  “Port WWN no of HBA card”  /dir/ bios file path 

Upgrade HBA Bios and Firmware in Linux - Emulex card

Below is the steps for uprgade HBA bios and firmware for Emulex card.

1.Down load the correct firmware and bios file from Emulex support site and down load HBAnyware utility kit which contains one command manager.

2.Copy the files to server 

U have to down load 3 files

A.Driver for FC card
B.Io controller file for emulex card
C.HBAnyware Library and Utilities Kit

3.Install the driver and IO controller module file first and reboot the server.

4.After server comes up install the HBAnyware utility.

5.Verify the firmware version before the upgrade 
cat /proc/scsi/lpfc/*

6.List the HBA that are manageable by HBAnywhere

 #/usr/sbin/hbanyware/hbacmd ListHBAs

7.Now upgrade firmware for HBA card one by one separately.

Upgrade firmware in HBA

# ./usr/sbin/hbanyware/hbacmd Download  “Port WWN no of HBA card”  /dir/ firmware file path  

( Need to run this command for all HBA cards on server)

Ex :

[root@@ hbanyware]# ./hbacmd Download 10:00:00:00:c9:84:b1:17 /tmp/EMULEX-2950/zf282a4.all

Downloading /tmp/EMULEX-2950/zf282a4.all to hba 10:00:00:00:c9:84:b1:17

Download Complete.

[root@ hbanyware]#

8.Upgrade BIOS code

Bios also need to update using the same command 

#./usr/sbin/hbanyware/hbacmd Download  “Port WWN no of HBA card”  /dir/ bios file path 

Install using GUI Mode

If you want to install using GUI mode then follow the below steps:

1. export DISPLAY="your server name"  ( Export the display to widows server where reflection has installed)

2. /usr/sbin/hbanyware/hbanyware  ( it will open a GUI window on windows server)

Click the HBA card and select Maintenance Tab --> Select firmware upgrade  button --> Select the path for the file And enter OK --> Click download ( it will install the Firmware)

Finding orphaned RPMs on Linux Server

Finding orphaned RPMs on Linux Server

If you use an RPM-based Linux distribution, you may have run into one or more cases were your system contains orphaned packages. An orphaned package is a package that doesn’t have any packages that depend on it, and in a number of cases the package is no longer required for the system to function correctly.

To view the list of orphaned packages on your Linux host, you can use rpmorphan tool

To install it, you can fire up yum:

$ yum install rpmorphan

Once installed, you can run it to view the list of orphaned packages on your system:

$ rpmorphan

To get additional information on what rpmorphan is doing, you can run it with the “-verbose” option. This is a super useful utility

Redhat recovery modes : Quick View

Redhat recovery modes

If you have ever had to deal with a sick Redhat server, you may be familiar with the rescue, emergency and singler-user modes of operation. 
I have heard people refer to rescue modes incorrectly, which can sometimes lead to some interesting stories (there are several slight subtleties between them). 

To clear up any confusion surrounding these terms, here are the official descriptions from the Redhat administration guide:

Rescue mode:

Rescue mode provides the ability to boot a small Red Hat Enterprise Linux environment entirely from CD-ROM, or some other boot method,instead of the system’s hard drive. As the name implies, rescue mode is provided to rescue you from something. During normal operation, your Red Hat Enterprise Linux system uses files located on your system’s hard drive to do everything รข€” run programs, store your files, and more.

Emergency Mode:

In emergency mode, you are booted into the most minimal environment possible. The root file system is mounted read-only and almost nothing is set up. The main advantage of emergency mode over single-user mode is that the init files are not loaded. If init is corrupted or not working, you can still mount file systems to recover data that could be lost during a re-installation.

Single-User mode:

In single-user mode, your computer boots to runlevel 1. Your local file systems are mounted, but your network is not activated. You have a usable system maintenance shell. Unlike rescue mode, single-user mode automatically tries to mount your file system. 

Do not use single-user mode if your file system cannot be mounted successfully. You cannot use single-user mode if the runlevel 1 configuration
 on your system is corrupted.
Blogger Tips and TricksLatest Tips And TricksBlogger Tricks