Amanda-Users

Re: driver: result time 0.022 from taper: TAPE-ERROR [not an amanda tape]

2004-04-30 11:44:32
Subject: Re: driver: result time 0.022 from taper: TAPE-ERROR [not an amanda tape]
From: Paul Bijnens <paul.bijnens AT xplanation DOT com>
To: freelsjd AT ornl DOT gov
Date: Fri, 30 Apr 2004 17:39:09 +0200
James D. Freels wrote:

Now I had to use another tape in the sequence.

the 2st "mt -f /dev/st0" before amcheck or amflush:

drive type = Generic SCSI-2 tape
drive status = 637534720
sense key error = 0
residue count = 0
file number = 0
block number = 0
Tape block size 512 bytes. Density code 0x26 (unknown).

This has fixed blocks of 512 bytes.
I never understood why this is the default value on some configs.
It works better if you set variable blocksize, indicated by 0 bytes.

I never exactly understood the boundary cases, but it seems
that each OS has it's own semantics when reading blocks from tape.

Suppose
   - You have a readbuffer of e.g. 32K
   - You read from a fixed-block-512bytes tape
Some OS's read one block of 512 bytes only,
Some other OS's read many blocks to fill as much as possible in
32 Kbyte buffer;  and there are differences in the handling
of the last block if it does not fit exactly in the buffer too.

When writing, a 32 Kbyte buffer is spread over multiple 512 blocks
(on all systems I tested).

The two portable ways on each OS are:
- read/write with the same blocksize as the tape is configured
- read/write in variable blocksize, and make sure you read with
  a blocksize that is an exact multiple of the tape, and be
  prepared to get less in one read call.
In both cases, be prepared to handle the last impartial block.

Amanda uses a default blocksize of 32Kbytes.  If you set variable
blocking and let amanda read/write the tapes, it "just works".

See also:
http://marc.theaimsgroup.com/?l=amanda-users&m=105605554715698&w=2
http://marc.theaimsgroup.com/?l=amanda-users&m=106560034410682&w=2


The tape drive has compression on according to the tapetype.  Could this
be the cause somehow  ?

No, not this problem, but on a DDS-4 tape you better have compression
off, unless you have a slow computer and NEED hardware compression to
get the backup done in time without too much load.
The pros and cons of hardware compression have been discussed a
zillion times on this list.  Search the archive and the FAQ's.


--
Paul Bijnens, Xplanation                            Tel  +32 16 397.511
Technologielaan 21 bus 2, B-3001 Leuven, BELGIUM    Fax  +32 16 397.512
http://www.xplanation.com/          email:  Paul.Bijnens AT xplanation DOT com
***********************************************************************
* I think I've got the hang of it now:  exit, ^D, ^C, ^\, ^Z, ^Q, F6, *
* quit,  ZZ, :q, :q!,  M-Z, ^X^C,  logoff, logout, close, bye,  /bye, *
* stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt,  abort,  hangup, *
* PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e,  kill -1 $$,  shutdown, *
* kill -9 1,  Alt-F4,  Ctrl-Alt-Del,  AltGr-NumLock,  Stop-A,  ...    *
* ...  "Are you sure?"  ...   YES   ...   Phew ...   I'm out          *
***********************************************************************