SCSI re-scan on Linux

No needs to reboot your Linux system if you add new fibre channel devices to it. You can discover them online.

This command will initiate the Loop Initialization Protocol for the selected adapter. The LIP sends a message to the HBA to look for new devices. Since you can have multiple fibre channel HBA’s make sure to send the LIP to the right adapter.

Example:
# echo 1 > /sys/class/fc_host/host<number>/issue_lip

After a LIP the FC adapter know the new devices, but the OS does not know about it yet. The next command will initiate a device discovery of the kernel SCSI layer.

# echo “- – -” > /sys/class/scsi_host/host<number>/scan

A tail on /var/log/messages or dmesg should unveil the newly found devices.

Feb 4 13:09:38 tamar kernel: Vendor: HP Model: Ultrium 5-SCSI Rev: I2DS
Feb 4 13:09:38 tamar kernel: Type: Sequential-Access ANSI SCSI revision: 06
Feb 4 13:09:38 tamar kernel: scsi 0:0:0:0: Attached scsi generic sg0 type 1>
Feb 4 13:09:38 tamar kernel: st: Version 20070203, fixed bufsize 32768, s/g segs 256
Feb 4 13:09:38 tamar kernel: st 0:0:0:0: Attached scsi tape st0
Feb 4 13:09:38 tamar kernel: st0: try direct i/o: yes (alignment 512 B)
(Visited 236 times, 1 visits today)