diff --git a/zconf/lstape b/zconf/lstape index 5501cb11..91609fbb 100755 --- a/zconf/lstape +++ b/zconf/lstape @@ -48,6 +48,9 @@ function PrintUsage() { : -v|--version : Display the version of the tools package and : the lstape command. + : + :$(basename $0) without the --ccw-only option causes extra SAN traffic + :for each SCSI tape or changer device by invoking the sg_inq command. EOD } @@ -249,11 +252,16 @@ function SysfsCreateListSCSI() if [ -h $SG_DEV ]; then # deprecated sysfs layout SG_DEV=$(echo $SG_DEV | awk -F: '{print $NF}') - else + elif [ -d $SCSI_DEV/scsi_generic ]; then SG_DEV=$(basename $SG_DEV/*) + else + SG_DEV="" fi - if [ "$SG_INQ" != "" ]; then + if [ -z "$SG_DEV" ]; then + SG_DEV="N/A" + TAPE_SERIAL="NO/SG" + elif [ "$SG_INQ" != "" ]; then TAPE_SERIAL=$( sg_inq /dev/$SG_DEV | awk '/serial/{print $NF}' diff --git a/zconf/lstape.8 b/zconf/lstape.8 index 069a8588..80d54e53 100644 --- a/zconf/lstape.8 +++ b/zconf/lstape.8 @@ -36,7 +36,13 @@ IBM tape driver this would be "IBMtape" or "IBMchanger". If "N/A" is shown, the correct driver could not be obtained. The serial number of a SCSI tape can be displayed with the --verbose option. If -there is no sg_inq command available "NO/INQ" is shown as the tape's serial. +there is no sg_inq command available "NO/INQ" is shown as the serial number +of the tape. +If no SCSI generic (sg) kernel support is available, "NO/SG" is shown +as the serial number of the tape and "N/A" for the "Generic" column. + +The lstape command without the --ccw-only option causes extra SAN traffic +for each SCSI tape or changer device by invoking the sg_inq command. .SH OPTIONS .TP 8