SCSI remove single device will work but add single device will not for the tape

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SCSI remove single device will work but add single device will not for the tape

zu_shyong_aik
Hello everyone,

I tried to simulate removal of single tape by doing a removal  and adding it back.

1. Removal works
2. Addition back of will not work (Tried rescan-scsi normal and forced mode but didn't work)

[root@node01 ~]# echo "scsi remove-single-device 1 0 12 0" > /proc/scsi/scsi
[root@node01 ~]# echo "scsi add-single-device 1 0 12 0" > /proc/scsi/scsi
-bash: echo: write error: Invalid argument
[root@node01 ~]# service mhvtl stop
shutdown of mhvtl
   Sending exit to 11
   Sending exit to 12
   Sending exit to 13
   Sending exit to 14
   Sending exit to 31
   Sending exit to 32
   Sending exit to 33
   Sending exit to 34
--> Last one hangs and the whole OS freezes.

Is this something expected to happen for scsi tape drives ?


My config - vanilla of mhvtl-0.18
-------------------------------------------------------------------------------------------
[root@node01 ~]# cat /etc/enterprise-release
Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
[root@node01 ~]# uname -r
2.6.18-194.el5
[root@node01 ~]# uname -a
Linux node01.linuxhome.local 2.6.18-194.el5 #1 SMP Mon Mar 29 20:06:41 EDT 2010 i686 i686 i386 GNU/Linux
[root@node01 ~]#
[root@node01 ~]# lsscsi -g
[0:0:0:0]    disk    VBOX     HARDDISK         1.0   /dev/sda  /dev/sg0
[0:0:1:0]    disk    VBOX     HARDDISK         1.0   /dev/sdb  /dev/sg1
[0:0:2:0]    disk    VBOX     HARDDISK         1.0   /dev/sdc  /dev/sg2
[0:0:3:0]    disk    VBOX     HARDDISK         1.0   /dev/sdd  /dev/sg3
[0:0:4:0]    disk    VBOX     HARDDISK         1.0   /dev/sde  /dev/sg4
[1:0:0:0]    mediumx STK      L700             550V  -         /dev/sg13
[1:0:1:0]    tape    IBM      ULT3580-TD5      550V  /dev/st0  /dev/sg5
[1:0:2:0]    tape    IBM      ULT3580-TD5      550V  /dev/st1  /dev/sg6
[1:0:3:0]    tape    IBM      ULT3580-TD4      550V  /dev/st2  /dev/sg7
[1:0:4:0]    tape    IBM      ULT3580-TD4      550V  /dev/st3  /dev/sg8
[1:0:8:0]    mediumx SPECTRA  PYTHON           550V  -         /dev/sg14
[1:0:9:0]    tape    IBM      ULT3580-TD4      550V  /dev/st4  /dev/sg9
[1:0:10:0]   tape    IBM      ULT3580-TD4      550V  /dev/st5  /dev/sg10
[1:0:11:0]   tape    IBM      ULT3580-TD4      550V  /dev/st6  /dev/sg11
[1:0:12:0]   tape    IBM      ULT3580-TD4      550V  /dev/st7  /dev/sg12
[root@node01 ~]#
-------------------------------------------------------------------------------------------

Thanks.

Aik
Reply | Threaded
Open this post in threaded view
|

Re: SCSI remove single device will work but add single device will not for the tape

Mark Harvey
Administrator
Hmmm, I wonder how I can stop somebody from doing the "add-single-devce" / "delete-single-device" for mhvtl devices ??

Please don't do this. It will cause all sorts of problems. Including as you have seen, kernel panics (oopses).

To 'remove' a device, use the 'vtlcmd' command which neatly stops the daemon and unregisters the device from the kernel.
To 'add' the device, start the daemon.

e.g. To remove device index # 11.

vtlcmd 11 exit

To start device 11.
vtltape -q 11 -v

Cheers
Mark
Regards from Australia
Mark Harvey