Jim Hammack wrote:
> How can I read > 32 Kbytes from a generic scsi device?  I am running
> kernel 2.2.13 and using a Sony SDT-9000 DAT drive.  I have data tapes
> with a 40960 byte block size.  I can read these tapes okay on an SGI
> under IRIX 6.5, but under Linux I only get 32K bytes.

That is correct. Linux currently by default only allows a maximum of 32K bytes
in fixed-block mode. This has been identified as a problem. 

You may try 

mt -f /dev/st1 setblk 0

and see if that will work, this puts the driver (and, presumably, tape drive)
into variable block mode. But I don't think it'll work even then. But it's
worth a try, because in the unlikely event that it does work, your problem is
solved :-). 

But I think you'll need to edit linux/drivers/scsi/st_options.h and increase
ST_BUFFER_BLOCKS to a bigger number (64 will definitely do you!). Re-compile
your kernel, install the kernel with the bigger ST_BUFFER_BLOCKS, then you'll
be able to do the following and have it work:

> mt -f /dev/st1 setblk 40960

The driver knows what block size it's trying to read, this is part of the tape
status info. The driver needs to re-size its buffer to be bigger than
ST_BUFFER_BLOCKS bytes when necessary upon READ's but currently doesn't.  I
don't know if this is fixed in the latest 2.3 drivers for the 'st' device. I
may take a look at it this weekend and see whether it has been fixed, or
whether I need to hack at it (but this is NOT an easy problem to solve, we're
talking about DMA buffers and possibly scatter-gather if we can't get enough
adjacent memory ... ).  

> with no effect.  I have tried using ioctl to set SG_SET_RESERVED_SIZE to
> 64K.  The ioctl seemed to work and I could use SG_GET_RESERVED_SIZE to
> verify it, but still no effect on reading the tapes.

You'd have to issue a raw SCSI "READ" command to do anything via the SCSI
Generic device. You don't want to do that unless you are extremely perverse
(believe me, I'm the guy who modified 'mtx' to use the SCSI Generic device
:-).  Much easier to re-compile a kernel with a bigger ST_BUFFER_BLOCKS. 

-- 
Eric Lee Green                         [EMAIL PROTECTED]
Software Engineer                      Visit our Web page:
Enhanced Software Technologies, Inc.   http://www.estinc.com/
(602) 470-1115 voice                   (602) 470-1116 fax

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to