While Working on the Linux boxes , some times linux admin have to scan new storage or LUNs assign to the server from the Storage team. In Redhat linux & CentOS we can scan the LUNs either using the script ‘rescan-scsi-bus.sh’ or using the ‘/sys/class’ files without rebooting the server.
In My scenario I have 4 FC (Fiber Channel) ports on the server , and new Luns are assigned on these ports. Follow the below steps to detect or scan new Luns :
First Check the Fibre channels using the below Command :
# ls /sys/class/fc_host host0 host1 host2 host3
Now Scan New luns using below Commands:
# 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
The sg3_utils package provides the rescan-scsi-bus.sh script, this script scans new luns on redhat linux and CentOS. So to use this script first we have to install sg3_utils rpm.
# yum install sg3_utils # ./rescan-scsi-bus.sh
Now the Check the newly discovered disks using ‘fdisk -l’ command or by ‘multipath -l’ command if configured.
I have run all the above cmds, but still i dont get my new luns. Is there any other cmd that i missed out.
Hi Amiya ,
After running above commands , if still new luns are not detected , i would prefer you please check with storage team whether they have assigned Luns to correct host, share the WWN numbers with them.