How to rescan SCSI bus to detect new storage devices


When adding a new disk drive to a running Virtual Machine, you will need to run device detection mechanism on the server. My VM is hosted in VMware and this is how my hardware config looks like after the disk was added:
rescan SCSI bus to detect new storage device

Run the following command, to find out the host bus on which the new device has been connected:

grep mpt /sys/class/scsi_host/host?/proc_name

The command should return something similar to :
/sys/class/scsi_host/host2/proc_name:mptspi

Now run the following command:

echo “- – -” > /sys/class/scsi_host/host2/scan

The three – charaters are represented by the controllers,channels and luns. The above command indicates that all of these three elements should be scanned
When you just expand an existing disk and you want the System to detect the changes, run the following command:
echo 1 > /sys/class/scsi_device/device/rescan
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s