public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* st.c block limits
@ 2002-07-30 20:20 ael
  2002-08-01  4:45 ` Kai Makisara
  0 siblings, 1 reply; 9+ messages in thread
From: ael @ 2002-07-30 20:20 UTC (permalink / raw)
  To: linux-scsi

I have a scsi tape drive:-

Host: scsi0 Channel: 00 Id: 00 Lun: 00
     Vendor: AIWA     Model: TD-20001         Rev: 0159
     Type:   Sequential-Access                ANSI SCSI revision: 02

It has worked perfectly for several years, but from kernel 2.4.10 st.c
started to report a 24-bit block limit: st0: Block limits 1 - 16777215 
bytes. I am now on stock 2.4.18 with static char *verstr = "20020205".

The above drive is a NS-20 drive with default block size of 512 and 20G 
blocks: so a range of 25 bits for the block number is needed.

So when I attempt to write to the tape beyond block 2^24,
I get an error like:

# tar -cf /dev/ntape blah_home.tar.bz2; mt  tell
tar: /dev/ntape: Wrote only 0 of 10240 bytes
tar: Error is not recoverable: exiting now
At block 17832312.

With:
    kernel: st0: Block limits 1 - 16777215 bytes.
in the kernel log.


Now I *think* that I used to write to the end of tapes without hitting this
2^24 block limit. I guess that I can work around by setting a larger block 
size. But is there a fix? Or is the 24-bit limit built into the scsi tape 
protocol? Since I used to fill 2 tapes to complete a backup, I must have 
written beyond block (2^24 -1).

Sorry if this is an FAQ. I did google and found nothing directly relevant.
When did st.c change and why? I did turn on DEBUG, and I append a few 
entries, although I am not sure that it helps much:

Jul 30 16:49:28 conquest3 kernel: st: Version 20020205, bufsize 32768, wrt
30720, max init. bufs 4, s/g segs 16
Jul 30 16:49:28 conquest3 kernel: Attached scsi tape st0 at scsi0, channel
0, id 0, lun 0
Jul 30 16:49:28 conquest3 kernel: st: Allocated tape buffer 0 (32768 bytes,
1 segments, dma: 1, a: c01e8000).
Jul 30 16:49:28 conquest3 kernel: st: segment sizes: first 32768, last
32768 bytes.
drwx------    2 ael      ael          4096 Nov  3  2001 Mail
Jul 30 16:49:28 conquest3 kernel: st0: Block limits 1 - 16777215 bytes.
Jul 30 16:49:28 conquest3 kernel: st0: Mode sense. Length 11, medium 85,
WBS 10, BLL 8
Jul 30 16:49:28 conquest3 kernel: st0: Density 0, tape length: 0, drv buffer: 1
Jul 30 16:49:28 conquest3 kernel: st0: Block size: 512, buffer size: 32768
(64 blocks).

After switching to 1K blocks and fsf'ing past existing data:-
--------------------------------------------------------------


Jul 30 17:28:50 conquest3 kernel: st0: Setting block size to 1024 bytes.
Jul 30 17:28:50 conquest3 kernel: st0: Rewinding tape.
Jul 30 17:28:52 conquest3 kernel: st0: Block limits 1 - 16777215 bytes.
Jul 30 17:28:52 conquest3 kernel: st0: Mode sense. Length 11, medium 85,
WBS 10, BLL 8
Jul 30 17:28:52 conquest3 kernel: st0: Density 0, tape length: 0, drv buffer: 1
Jul 30 17:28:52 conquest3 kernel: st0: Block size: 1024, buffer size: 32768
(32 blocks).
Jul 30 17:28:52 conquest3 kernel: st0: Rewinding tape.
Jul 30 17:29:36 conquest3 kernel: st0: Block limits 1 - 16777215 bytes.
Jul 30 17:29:36 conquest3 kernel: st0: Mode sense. Length 11, medium 85,
WBS 10, BLL 8
Jul 30 17:29:36 conquest3 kernel: st0: Density 0, tape length: 0, drv buffer: 1
Jul 30 17:29:36 conquest3 kernel: st0: Block size: 1024, buffer size: 32768
(32 blocks).
Jul 30 17:29:36 conquest3 kernel: st0: Spacing tape forward over 12 filemarks.
Jul 30 17:32:28 conquest3 kernel: st0: Block limits 1 - 16777215 bytes.
Jul 30 17:32:28 conquest3 kernel: st0: Mode sense. Length 11, medium 85,
WBS 10, BLL 8
Jul 30 17:32:28 conquest3 kernel: st0: Density 0, tape length: 0, drv buffer: 1
Jul 30 17:32:28 conquest3 kernel: st0: Block size: 1024, buffer size: 32768
(32 blocks).
Jul 30 17:32:28 conquest3 kernel: st0: Got tape pos. blk 17832312 part 0.

Thanks in advance for any help

ael




^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: st.c block limits
@ 2002-08-01 16:06 Bryan Henderson
  0 siblings, 0 replies; 9+ messages in thread
From: Bryan Henderson @ 2002-08-01 16:06 UTC (permalink / raw)
  To: Rogier Wolff; +Cc: 'ael', linux-scsi, Tony Battersby


>It's easy to prevent this from costing too much: Simply prepend a
>block of data with a "1" compressed or "0" uncompressed bit.
>
>Max expansion is then 1 bit per block. (At a cost of one extra bit per
>block).

Could you elaborate on this?  What does "'1' compressed or '0' uncompressed
bit" mean?  Where exactly do you do this prepending?  Is this according to
some protocol that has a name?




^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: st.c block limits
@ 2002-08-01 16:53 Bryan Henderson
  0 siblings, 0 replies; 9+ messages in thread
From: Bryan Henderson @ 2002-08-01 16:53 UTC (permalink / raw)
  To: Rogier Wolff; +Cc: linux-scsi


>I mean that if the compression doesn't have "blocks" (like a gzip or
>compress algorithm), then you chose a more or less arbitrary block size.
>Say 1024 bytes.
>
>Then when compression of a block of data leads to an expansion, you
>just store a "0" bit, followed by the block. If the block size is 1024
>bytes, then this costs 1024.125 bytes of storage (8193 bits). If the
>compression /is/ succesful, then you just store a "1" bit followed by
>the compressed data (less than 1024 bytes....).

Oh, so you're talking about a way the tape drive could be engineered so we
wouldn't have to worry about expansion.  It sounded like you might be
talking about something a user of an existing tape drive could do to avoid
the problem.


BTW, one other reason that you wouldn't be able to fit 10GB on a nominally
10GB tape is defects in the medium, particularly those that arose after
manufacture.  The drive will automatically skip bad parts of the tape.




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-08-01 22:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-30 20:20 st.c block limits ael
2002-08-01  4:45 ` Kai Makisara
2002-08-01 11:46   ` ael
2002-08-01 13:14     ` Tony Battersby
2002-08-01 15:49       ` Rogier Wolff
2002-08-01 22:51       ` ael
2002-08-01 11:57   ` ael
  -- strict thread matches above, loose matches on Subject: below --
2002-08-01 16:06 Bryan Henderson
2002-08-01 16:53 Bryan Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox