分类: LINUX
2010-04-19 19:39:59
The 2.6.11 Linux kernel introduced certain changes to the lpfc (emulex driver) and qla2xxx (Qlogic driver) Fibre Channel Host Bus Adapter (HBA) drivers which removed the following entries from the proc pseudo-filesystem: /proc/scsi/qla2xxx, /proc/scsi/lpfc. These entries had provided a centralized repository of information about the drivers and connected hardware. After the changes, the drivers started storing all this information within the /sys filesystem. Since Red Hat Enterprise Linux 5 uses version 2.6.18 of the Linux kernel it is affected by this change.
Using the /sys filesystem has the advantage that all the Fibre Channel drivers now use a unified and consistent manner to report data. However it also means that the data previously available in a single file is now scattered across a myriad of files in different parts of the /sys filesystem.
One basic example is the status of a Fibre Channel HBA: checking this can now be accomplished with the following command:
# cat /sys/class/scsi_host/host#/state
where host# is the H-value in the HBTL SCSI addressing format, which references the appropriate Fibre Channel HBA. For emulex adapters (lpfc driver) for example, this command would yield:
# cat /sys/class/scsi_host/host1/state
Link Up - Ready:
Fabric
For qlogic devices (qla2xxx driver) the output would instead be as follows:
# cat /sys/class/scsi_host/host1/state
Link Up - F_Port
Obviously it becomes quite impractical to search through the /sys filesystem for the relevant files when there is a large variety of Fibre Channel-related information of interest. Instead of manual searching, the systool (1) command provides a simple but powerful means of examining and analysing this information. Detailed below are several commands which demonstrate samples of information which the systool command can be used to examine.
To examine some simple information about the Fibre Channel HBAs in a machine:
# systool -c fc_host -v
To look at verbose information regarding the SCSI adapters present on a system:
# systool -c scsi_host -v
To see what Fibre Channel devices are connected to the Fibre Channel HBA cards:
# systool -c fc_remote_ports -v -d
For Fibre Channel transport information:
# systool -c fc_transport -v
For information on SCSI disks connected to a system:
# systool -c scsi_disk -v
To examine more disk information including which hosts are connected to which disks:
# systool -b scsi -v
Furthermore, by installing the sg3_utils package it is possible to use the sg_map command to view more information about the SCSI map. After installing the package, run:
# modprobe sg
# sg_map -x
Finally, to obtain driver information, including version numbers and active parameters, the following commands can be used for the lpfc and qla2xxx drivers respectively:
# systool -m lpfc -v
# systool -m qla2xxx -v
ATTENTION: The syntax of the systool (1) command differs across versions of Red Hat Enterprise Linux. Therefore the commands above are only valid for Red Hat Enterprise Linux 5.