Detect & Scan New Luns in Redhat Linux & CentOS

2
5519


Overview:

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 :

Method:1

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
Method:2

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.


SHARE

2 COMMENTS

    • 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.

LEAVE A REPLY