Storage

Rescan a SCSI bus without rebooting

rescan hard-drive Normally, after adding a hotplug-capable HDD to Linux (on a VM or physical machine), running:

# fdisk -l

does not show the HDD until the machine is rebooted. To have Linux detect the new HDD without rebooting, rescan SCSI. To scan SCSI:

  1. ตรวจสอบจำนวน scsi controller
    # ls /sys/class/scsi_host
    host0 host1 host2
  2. Based on the output above, rescan host0, host1, and host2 by running the following commands.

    # echo "- - -" > /sys/class/scsi_host/host0/scan
    # echo "- - -" > /sys/class/scsi_host/host1/scan
    # echo "- - -" > /sys/class/scsi_host/host2/scan

English reading note: The Thai line in the first preserved example means “Check the number of SCSI controllers.” The example lists host0, host1, and host2.

EOF.← Back to articles