Subject: scsi tape weirdness
To: None <current-users@NetBSD.ORG, rhialto@polder.ubc.kun.nl>
From: Olaf Seibert <rhialto@polder.ubc.kun.nl>
List: current-users
Date: 06/17/1995 01:13:38
I have some weird problems with a tape drive:

Jun 17 00:02:45 polder /netbsd: aha0 targ 0 lun 0: <WANGTEK ,5150ES SCSI FA15,01 A> SCSI1 sequential removable
Jun 17 00:02:45 polder /netbsd: st0 at scsibus0: rogue, drive offline

I added a rogue entry for it with the ST_Q_IGNORE_LOADS flag to
scsi/st.c, like its brother 5525ES, but that doesn't seem to make a
difference.  I also modified mt to do status, density and blocksize.

The problem is that it can do density-code 16 (QIC-150) but it doesn't
do it. It even fails to read such tapes unless they are in the drive
when powered on. I do know for a fact that the drive can do it since it
has worked in the past (with Linux, no less).

I compiled a kernel with level-1 debugging for the tape unit, and part
of the resulting log is below. It shows the commands mt density 16, mt
status and tar cvv . to fail and then mt density 15, mt status, and tar
cvv . to succeed. Note that the tape accepts the density 16 setting,
while it rejects many others, so one guesses that it really should work.

Perhaps anybody who actually knows something about scsi can look at the
differences and see what the problem is.  I somehow suspect (and I hope)
that the kernel mistakenly interprets the tape drive's response wrong.
Whatever the kernel is doing looks quite straightforward to me.

(I clipped off the initial part of each line,
Jun 17 00:37:45 polder /netbsd: )

export TAPE=/dev/nrst0	; the block device behaves substantially identical
mt density 16	; I think I interspersed my commands at the right places

st0(aha0:0:0): command: 1,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): command: 1e,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): mounting
 st0(aha0:0:0): command: 1b,0,0,0,1,0-[0 bytes]
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): command: 5,0,0,0,0,0-[6 bytes]
------------------------------
000: 00 00 02 00 02 00 
------------------------------
st0(aha0:0:0): command: 1a,0,0,0,c,0-[12 bytes]
------------------------------
000: 0b 00 10 08 0f 00 00 00 00 00 02 00 
------------------------------
st0(aha0:0:0): command: 15,0,0,0,c,0-[12 bytes]
------------------------------
000: 00 00 10 08 0f 00 00 00 00 00 02 00 
------------------------------
st0(aha0:0:0): command: 1e,0,0,0,1,0-[0 bytes]
st0(aha0:0:0): [ioctl: op=0xf count=0x10]
st0(aha0:0:0): command: 15,0,0,0,c,0-[12 bytes]
------------------------------
000: 00 00 10 08 10 00 00 00 00 00 02 00 
------------------------------
st0(aha0:0:0): closing

mt status, shows that density setting 16 went ok.

st0(aha0:0:0): open: dev=0xe01 (unit 0 (of 4))
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): [ioctl: get status]
st0(aha0:0:0): closing

tar cvv .

st0(aha0:0:0): open: dev=0xe01 (unit 0 (of 4))
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): ststrategy 10240 bytes @ blk 0
st0(aha0:0:0): command: a,1,0,0,14,0-[10240 bytes]
------------------------------
000: 2e 2f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
------------------------------
code70 valid0 seg0 key5 ili0 eom0 fmark0
info: 0 0 0 0 followed by 40 extra bytes
extra: 0 8 0 0 0 0 21 0 12 10 11 0 0 0 0 80 60 19 10 0 0 1a 15 1e 0 0 0 0 0 0 0 0 a 1 0 0 14 0 0 0 
st0(aha0:0:0): illegal request
st0(aha0:0:0): closing
st0(aha0:0:0): command: 10,0,0,0,1,0-[0 bytes]
code70 valid0 seg0 key5 ili0 eom0 fmark0
info: 0 0 0 0 followed by 40 extra bytes
extra: 0 8 0 0 0 0 21 0 12 10 11 0 0 0 0 80 60 19 10 0 0 1e 15 0 0 0 0 0 0 0 0 0 10 0 0 0 1 0 0 0 
st0(aha0:0:0): illegal request

mt status

st0(aha0:0:0): open: dev=0xe01 (unit 0 (of 4))
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): [ioctl: op=0xf count=0xf]
st0(aha0:0:0): command: 15,0,0,0,c,0-[12 bytes]
------------------------------
000: 00 00 10 08 0f 00 00 00 00 00 02 00 
------------------------------
st0(aha0:0:0): closing

mt offline

st0(aha0:0:0): open: dev=0xe01 (unit 0 (of 4))
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): [ioctl: op=0x6 count=0x1]
st0(aha0:0:0): unmounting
st0(aha0:0:0): command: 1,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): command: 1e,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): command: 1b,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): closing

mt density 15

st0(aha0:0:0): open: dev=0xe01 (unit 0 (of 4))
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): mounting
 
st0(aha0:0:0): command: 1b,0,0,0,1,0-[0 bytes]
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): command: 5,0,0,0,0,0-[6 bytes]
------------------------------
000: 00 00 02 00 02 00 
------------------------------
st0(aha0:0:0): command: 1a,0,0,0,c,0-[12 bytes]
------------------------------
000: 0b 00 10 08 0f 00 00 00 00 00 02 00 
------------------------------
st0(aha0:0:0): command: 15,0,0,0,c,0-[12 bytes]
------------------------------
000: 00 00 10 08 0f 00 00 00 00 00 02 00 
------------------------------
st0(aha0:0:0): command: 1e,0,0,0,1,0-[0 bytes]
st0(aha0:0:0): [ioctl: op=0xf count=0xf]
st0(aha0:0:0): command: 15,0,0,0,c,0-[12 bytes]
------------------------------
000: 00 00 10 08 0f 00 00 00 00 00 02 00 
------------------------------
st0(aha0:0:0): closing

tar cvv .

st0(aha0:0:0): open: dev=0xe01 (unit 0 (of 4))
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): [ioctl: op=0xf count=0xf]
st0(aha0:0:0): command: 15,0,0,0,c,0-[12 bytes]
------------------------------
000: 00 00 10 08 0f 00 00 00 00 00 02 00 
------------------------------
st0(aha0:0:0): closing
st0(aha0:0:0): open: dev=0xe01 (unit 0 (of 4))
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): command: 0,0,0,0,0,0-[0 bytes]
st0(aha0:0:0): ststrategy 10240 bytes @ blk 0
st0(aha0:0:0): command: a,1,0,0,14,0-[10240 bytes]
------------------------------
000: 2e 2f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
------------------------------

lots more that goes ok...

-Olaf.
--
___ Olaf 'Rhialto' Seibert      D787B44DFC896063 4CBB95A5BD1DAA96 
\X/ There are no lemurs in this post    rhialto@polder.ubc.kun.nl