Linux SCSI Scan – is it still echo “- – -” in Linux 3.2

linuxscsi

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?

Best Answer

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.