Rescan all SCSI buses, hassle free.
-
One of the things I've been doing a lot of lately is adding drives to virtual machines. This can be done hassle free, but almost all instructions found online make you find the correct bus to use. There is no reason to spend the time to track down the proper bus to scan when you can scan them all in one shot.
for host in /sys/class/scsi_host/*; do echo "- - -" | sudo tee $host/scan; done
I can't find the original reference for where I first found this. It was one of those, why didn't I think of that moments.