Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Apr 1998 21:36:20 -0700 (PDT)
From:      Julian Elischer <julian@whistle.com>
To:        Harlan Stenn <Harlan.Stenn@pfcs.com>
Cc:        freebsd-scsi@FreeBSD.ORG
Subject:   Re: does CAM do this? 
Message-ID:  <Pine.BSF.3.95.980425212713.4815B-100000@current1.whistle.com>
In-Reply-To: <15923.893554380@brown.pfcs.com>

next in thread | previous in thread | raw e-mail | index | archive | help


On Sat, 25 Apr 1998, Harlan Stenn wrote:
> I beg to differ.
> 
> I agree that the read will return no more than I ask for.
> 
> However...
> 
> With the default tape drive configuration (on the drives I've tested), if I 
> have a Large file on the tape blocked at, say, 10k bytes, if I issue a 
> read of "more than 10k but less than the size of the file" I'll get back 
> exactly what I asked for.
> 
> I cannot tell that the tape was blocked at 10k bytes.


the only whay this can be true is if the drive is in FIXED BLOCK MODE.

In fixed mode, a 10 K read is written to tape as 10 x 1K blocks
(or whatever the blocksize you have selected using mt(1) is.

If you then read 16K, you get back 16 x 1k blocks (or whatever the
blocksize is)

If you set the blocksize (using mt(1) to (say) 10k,
and put in a tape with 1k blocks, and try read 10k,
then the driver will request a single 10k block from the drive.
The drive will respond with "hey are you nuts? I only got 1k block here"
The driver will then print out an error message on the console.
which will give you SOME idea of what teh record size SHOULD have been
(probably the number -(9 x 1k) will appear in the message somewhere.)

alternatively you could set the record size to 20 btes and tray read 20
bytes..
a similar thing should occur.
the erro message you see on the console should give you a CLUE
as to what the (fixed) recod size is..

If your drive were in VARIABLE mode, then each read returns at most ONE
record. If there is more data in the record than you tried to read, you
get an error. (and a message)
if there is less, you get less, and no error.

At least that's what used to happen when I wrotethe driver a few years
ago so consider this to be "from the horse's mouth, but possibly dated"

ok?

experiment with mt(1) and dd(1)

julian



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.980425212713.4815B-100000>