Storage

How to rescan the SCSI bus to add or remove a SCSI device without reboot

Linux supports online SCSI drive rescanning, avoiding a system restart. To rescan SCSI drives without rebooting, run:

echo "1" > /sys/class/fc_host/host/host#/issue_lip
echo "- - -" > /sys/class/scsi_host/host/host#/scan

Here, # is the number of the SCSI bus to rescan. If you do not want to rescan everything, use the following: Remove a device:

# echo "scsi remove-single-device <H> <C> <I> <L>" > /proc/scsi/scsi

Add a device:

# echo "scsi add-single-device <H> <C> <I> <L>" > /proc/scsi/scsi

Warning Do not use this command with hardware that does not support hotplug. There is no guarantee against data corruption or abnormal SCSI behavior, so rebooting the system is still preferable.

EOF.← Back to articles