Devices
To configure the newly added LUNS on RHEL:
ls /sys/class/fc_host host0 host1 host2 host3 fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l echo "1" > /sys/class/fc_host/host0/issue_lip echo "- - -" > /sys/class/scsi_host/host0/scan echo "1" > /sys/class/fc_host/host1/issue_lip echo "- - -" > /sys/class/scsi_host/host1/scan echo "1" > /sys/class/fc_host/host2/issue_lip echo "- - -" > /sys/class/scsi_host/host2/scan echo "1" > /sys/class/fc_host/host3/issue_lip echo "- - -" > /sys/class/scsi_host/host3/scan cat /proc/scsi/scsi | egrep -i 'Host:' | wc -l fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l
Alternatively, we can run the re-scan-scsi script.
To scan new LUNs on Linux operating system which is using QLogic driver
You need to find out driver proc file /proc/scsi/qlaXXX. For example on my system it is /proc/scsi/qla2300/0
Once file is identified you need to type following command (login as the root user):
# echo "scsi-qlascan" > /proc/scsi/qla2300/0 # cat /proc/scsi/qla2300/0
Now use the script rescan-scsi-bus.sh new LUN as a device. Run script as follows:
# ./rescan-scsi-bus.sh -l -w
Download the script from here
The output of ls -l /sys/block/*/device should give you an idea about how each device is connected to the system.
How to differentiate local storage from SAN LUN
In the example below red is a virtual disk on an internal RAID controller, green is a CD-ROM connected via an IDE controller, and the rest are SAN-connected SCSI disks where "hostN" refers to the instance of the Host Bus Adapter they are connected to.
# ls -l /sys/block/*/device lrwxrwxrwx 1 root root 0 Sep 19 02:11 /sys/block/cciss!c0d0/device -> ../../devices/pci0000:00/0000:00:04.0/0000:0d:00.0/disk0 lrwxrwxrwx 1 root root 0 Sep 19 02:11 /sys/block/hda/device -> ../../devices/pci0000:00/0000:00:1f.1/ide0/0.0 lrwxrwxrwx 1 root root 0 Sep 18 14:58 /sys/block/sda/device -> ../../devices/pci0000:00/0000:00:02.0/0000:13:00.0/host0/target0:0:0/0:0:0:0 lrwxrwxrwx 1 root root 0 Sep 18 14:58 /sys/block/sdb/device -> ../../devices/pci0000:00/0000:00:02.0/0000:13:00.0/host0/target0:0:0/0:0:0:1 lrwxrwxrwx 1 root root 0 Sep 18 14:58 /sys/block/sdc/device -> ../../devices/pci0000:00/0000:00:02.0/0000:13:00.0/host0/target0:0:0/0:0:0:64 lrwxrwxrwx 1 root root 0 Sep 18 14:58 /sys/block/sdd/device -> ../../devices/pci0000:00/0000:00:02.0/0000:13:00.0/host0/target0:0:0/0:0:0:120 ...