I'm working with attaching new SCSI drives to a virtual host, and the current method in my team's work instructions is to rescan the SCSI bus with:

echo "- - -" > /sys/class/scsi_host/host0/scan

However, this was written a few years back, and we've moved on to newer Linux 3.2 systems. Is the method still echo "- - -"... so many things today in Linux are a bit nicer and less arcane... is there a new method I'm unaware or is this still how its done?

  • 1
    It's a virtual machine? This depends a lot on the hypervisor, and you failed to mention it. – Michael Hampton Aug 24 '13 at 5:22
  • I'm not sure why the hypervisor is relevant, I'm working inside the Linux VM to rescan the SCSI bus. But, for what it's worth, its VmWare. – Joe Aug 24 '13 at 5:38
  • 1
    Which version of VMware? VMware is a company, not a product. And which drivers are you using? – Michael Hampton Aug 24 '13 at 5:41

In the Red Hat storage administration guide, the method you mentioned is there, along with some other options which you might prefer.

echo "- - -" > /sys/class/scsi_host/hosth/scan

[...] This procedure will add LUNs, but not remove them.

There's also the less arcane /usr/bin/rescan-scsi-bus.sh, which has the advantage that it can also remove devices.

The same /sys/class/scsi_host/ tree is still there in 3.2, so there's still nothing preventing one from scanning for new devices using that method.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.