scan for luns

Latest response

Hello guys,

thanks for helping me with this. If you have your SAN connect to RHEL by fiber channel , how do you scan for luns?

I have worked with iscsi, I can't find any documents from red hat documenting how to scan for luns connected by fiber channel.

Thanks guys

Arrey

Responses

Hi Ashu,
Make the operating system aware of the new storage device, or path to an existing device. The recommended command to use is:

echo "c t l" > /sys/class/scsi_host/hosth/scan

In the previous command, h is the HBA number, c is the channel on the HBA, t is the SCSI target ID, and l is the LUN.

It should look like something like this.

echo "0 2 56" > /sys/class/scsi_host/host5/scan

Refer to this article.

https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/adding_storage-device-or-path.html

The advice above is solid.

I generally will install sg3_utils and run rescan-scsi-bus.sh

ls -l /dev/sd* > /var/tmp/sd-0.out
multipath -ll -v2 > /var/tmp/multipath-ll-v2-0.out
yum -y install sg3_utils
rescan-scsi-bus.sh
ls -lart /dev/sd* 
ls -lart /dev/mapper

Then to review the differences...

ls -l /dev/sd* > /var/tmp/sd-1.out
multipath -ll -v2 > /var/tmp/multipath-ll-v2-1.out
sdiff /var/tmp/sd-0.out /var/tmp/sd-1.out
sdiff /var/tmp/multipath-ll-v2-0.out /var/tmp/multipath-ll-v2-1.out

Thanks guys for the info. Very helpful . I think rescan-scsi-bus.sh is the best way to go. In solaris, devfsadm is all that is needed. Thanks again guys

Thanks to James, very useful info.

My pleasure - I think rescan-scsi-bus.sh is the closest you will get to replacing "devfsadm -Cv" - depending on what I am doing, I may also compare /proc/diskstats or some other output to make sure that the devices were discovered.

While convenient, rescan-scsi-bus.sh has known issues that you need to be aware of. See https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/logical-unit-add-remove.html. There are no issues with the 'echo' command provided above by Farrukh.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.