The SCSI interface is widely used in the server because of its wide application, multitasking, high bandwidth, low CPU usage, and hot Plug and unplug.
Of course, with the support of the virtualization platform, can also simulate the SCSI device, to facilitate the hot addition of SCSI devices on the virtual machine (usually hard disk)
However, after the hot-add SCSI device, you need to manually rescan the SCSI device.
A common practice is to enter the following command
Echo " - - - " >/sys/class/scsi_host/host*/scan
centos/rhel5.9 Start (Suse11/12 also has this tool) provides a toolkit Sg3_utils also easy to implement rescan operations
Yum Install /usr/bin/rescan-scsi-bus. SH
You can rescan SCSI devices
The following is a description of rescan-scsi-bus.sh
#/usr/bin/rescan-scsi-bus.SH--Helpusage:rescan-scsi-bus.SH[ options] [host [host ...]] Options:-a scan all targets, not just currently existing [default:disabled]-d enable debug [default:0] -L Activates scanning forLUNs0--7[Default:0] -L NUM Activates scanning forLUNs0--num [Default:0] -WScan forTarget device IDs0-- the[Default:0--7] -C enables scanning of channels0 1[Default:0/All detected ones]-m update multipath devices [default:disabled]-R enables removing of devices [default:disabled]-F Flush Failed multipath devices [default:disabled]-I issue a fibrechannel LIP reset [default:disabled]-U look forexisting disks that has been remapped-S look forresized disks and reload associated multipath devices,ifapplicable--alltargets:same AS-a--remove:same AS-R--flush:same AS-F--issue-lip:same AS-I--wide:same AS-W--multipath:same AS-m--forceremove:remove stale Devices (dangerous)--Forcerescan:remove and readd existing devices (dangerous)--nooptscan:don'T stop looking for LUNs if 0 are not found--color:use Coloured prefixes old/new/DEL--hosts=list:scan only Host (s)inchLIST--channels=list:scan only channel (s)inchLIST--ids=list:scan only target ID (s)inchLIST--luns=list:scan only LUN (s)inchLIST--Sync/nosync:issue ASync/NoSync[Default:Sync ifRemove]--attachpq3:tell kernel to attach SG to LUN0That reports pq=3--Reportlun2:tell Kernel to try Report_lun even on SCSI2 devices--largelun:tell kernel to support LUNs >7even on SCSI2 devs--Sparselun:tell kernel to support sparse LUN numbering--update:same AS-u--resize:same AS-s Host numbers may thus is specified either directly on CMD line (deprecated) or or with the--hosts=LIST parameter (recommended). list:a[-b][,c[-D]] ... is a comma separated list of single values and ranges (No spaces allowed.)
This article references the following links
How does I rescan a HP Smart Array for new devices without rebooting?
How to rescan the SCSI bus to add or remove a SCSI device without rebooting the computer
Adding/removing A LOGICAL UNIT THROUGH rescan-scsi-bus. Sh
Howto:add, Resize and Remove LUNs without restarting SLES or OES Linux
Linux Online scan hot-add SCSI/ISCSI device