Hot Swap Ultra320 SCSI LTO-Tape Drive

Can an Ultra320 SCSI LTO tape drive (or any SCSI device) be hot swapped without needing to power down the system? The current LTO tape drive is the only device on the SCSI host.

If the above can be done, then what problem(s) could I run into when I scan the SCSI bus after doing a hot swap?


If Linux, I try to rmmod or modprobe -r the relevant SCSI HBA modules to remove the device from the OS. In the case of a drive on an MPT Fusion controller I use the following:

rmmod mptspi 
rmmod mptscsih 
rmmod mptctl 
rmmod mptbase 

dmesg will report: "mptctl: Deregistered /dev/mptctl @ (major,minor=10,220)"

At that point, the device can be unplugged. To reinitialize or add a new device, I just modprobe mptspi or modprobe mptscsih and go from there...

For Adaptec, you'd rmmod the aic7xxx driver, replace the drive, then modprobe the driver.


In my experience this can be done. The risk is a bus-reset on the SCSI bus, which can definitely affect any other devices on the bus. Since this is an LTO tape drive, chances are pretty good only other tape drives are on it so they're probably OK. The biggest thing is to ensure no system resources are attempting to access the drive when you do the work (turn off your backup software, mostly).

Not all operating-systems behave well though, so it can be hit or miss.


I've never tried this, but according this link you can use this command:

echo 1 > /sys/class/scsi_device/h:c:t:l/device/delete

where where h is the HBA number, c is the channel on the HBA, t is the SCSI target ID, and l is the LUN. This numbers you can find in the dmesg listing.

In this link is it descripted for block device, like disk, but I think, that it is universal solution for SCSI devices...