LUN identification for the Linux host system

This section describes LUN identification for the Linux host system.

In Linux 2.4 kernels, SCSI devices are discovered by scanning the SCSI bus when the host adapter driver is loaded. A list of devices which have been discovered and are recognized by the SCSI subsystem are listed in /proc/scsi/scsi. It is good practice to use the cat command to display the output of /proc/scsi/scsi to verify that the correct number of LUNs has been recognized by the kernel. Figure 1 shows an example /proc/scsi/scsi file.
Figure 1. Output of the cat /proc/scsi/scsi command that shows that ten SCSI devices are detected in total
# cat proc/scsi/scsi
# cat /proc/scsi/scsi | less
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM-PSG  Model: DDYS-T36950M  M  Rev: S96E
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi1 Channel: 00 Id: 08 Lun: 00
  Vendor: IBM      Model: YGLv3 S2         Rev: 0
  Type:   Processor                        ANSI SCSI revision: 02
Host: scsi4 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM      Model: 1750500          Rev: 5.17
  Type:   Direct-Access                    ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 01
  Vendor: IBM      Model: 1750500          Rev: 5.17
  Type:   Direct-Access                    ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 02
  Vendor: IBM      Model: 1750500          Rev: 5.17
  Type:   Direct-Access                    ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 03
  Vendor: IBM      Model: 1750500          Rev: 5.17
  Type:   Direct-Access                    ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 04
  Vendor: IBM      Model: 1750500          Rev: 5.17
  Type:   Direct-Access                    ANSI SCSI revision: 05 
Host: scsi4 Channel: 00 Id: 00 Lun: 05
  Vendor: IBM      Model: 1750500          Rev: 5.17
  Type:   Direct-Access                    ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 06
  Vendor: IBM      Model: 1750500          Rev: 5.17
  Type:   Direct-Access                    ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 07
  Vendor: IBM      Model: 1750500          Rev: 5.17
  Type:   Direct-Access                    ANSI SCSI revision: 05
Note: The /proc/scsi/scsi list of devices is not dynamic and does not reflect state changes caused by fabric changes. Please see the section on “Dynamic SAN fabric reconfiguration’ for more information on how to deal with fabric changes.

Starting with the Linux 2.6 kernels, the /proc filesystem is migrating over to the improved /sys filesystem. The /sys filesystem supports dynamic changes such as adding and removing LUNs without requiring a host adapter driver reload or rebooting the host system. Typically, more accurate information about what SCSI devices are recognized by the host system is attained by checking the contents of the directory /sys/class/scsi_host/hostN, where N is host adapter ID number. lsscsi is a user-space tool that uses the information in /sys to display a summarized list of all the recognized devices. This tool may not currently be available on all Linux 2.6 distribution kernels.

Note: The lsscsi command is only supported on the SLES distributions.
Library | Support | Terms of use | Feedback
© Copyright IBM Corporation 2004, 2007. All Rights Reserved.