Tuesday, September 20, 2011

LUN identification for the Linux host system

This topic 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.

The following is example output:


# cat proc/scsi/scsi
# cat /proc/scsi/scsi | less
Attached devices:
Host: scsi1 Channel: 00 Id: 02 Lun: 00
Vendor: IBM Model: 2107900 Rev: .248
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi1 Channel: 00 Id: 02 Lun: 01
Vendor: IBM Model: 2107900 Rev: .248
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi1 Channel: 00 Id: 03 Lun: 00
Vendor: IBM Model: 2107900 Rev: 5.53
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi1 Channel: 00 Id: 03 Lun: 01
Vendor: IBM Model: 2107900 Rev: 5.53
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 restarting 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.

1 comment :

  1. Really job you are doing and this is excellent information for me.Website Hosting India

    ReplyDelete