Posts

Showing posts from April, 2010

Online LUN detection in RHEL 5

Things have changed much post migration from RHEL 4 to RHEL 5. In 4, we can easily detect the luns by sending an echo command to rescan the HBA adapter driver, however in 5 this does not work or shall I say it is not available. But still I feel their should be some mechanism to query either the hba driver or the SCSI mid layer. I have tried the following on RHEL 5 to scan for the new luns and found it to work, but do not try it on production. # for name in `ls /sys/class/scsi_device`; do echo 1 > /sys/class/scsi_device/$name/device/rescan ;done Or use blockdev per device # for name in `ls /dev`; do blockdev --rereadpt /dev/$name ;done Got a script to do the same: ####### Script starts ######## #!/bin/bash FDBf=/tmp/fdbf FDAf=/tmp/fdaf PBf=/tmp/pbf PAf=/tmp/paf #before fdisk output fdisk -ll | egrep Disk | egrep -v emcpower >> $FDBf #before powerpath powermt display dev=all | egrep Pseudo >> $PBf Lun=$1 for name in `ls /sys/class/fc_transport/ | awk -Ft '{print $3}...