5

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?

Bryan
  • 7,538
  • 15
  • 68
  • 92
U85
  • 121
  • 4

3 Answers3

3

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.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
2

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.

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
  • This is the only device on the SCSI host and Linux is the OS. – U85 Jan 25 '12 at 19:47
  • @U85 That's even less likely to cause problems. – sysadmin1138 Jan 25 '12 at 19:48
  • Is there any risk of hardware damage doing this? Of course I would turn off the tape drive prior to removal (aka unplug it from power). – U85 Jan 25 '12 at 19:53
  • @u85 No, not really. The voltages on SCSI busses aren't enough to damage things. Termination is the one area that might *possibly* cause problems, but ensuring the SCSI bus is quiescent when you make the swap is how to make sure nothing will notice. – sysadmin1138 Jan 25 '12 at 20:00
1

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...

Jan Marek
  • 2,120
  • 1
  • 13
  • 14