Amanda-Users

Re: Question about changing Tape Drive

2005-09-30 13:06:28
Subject: Re: Question about changing Tape Drive
From: Paul Bijnens <paul.bijnens AT xplanation DOT com>
To: sgw AT amanda DOT org
Date: Fri, 30 Sep 2005 18:58:38 +0200
Stefan G. Weichinger wrote:

Paul, could you tell us about the advantages of using variable blocksize?

I've put it on my todo list -- very busy now.

In short:
- larger blocks == usually more efficient
- variable blocks == one write() syscall results in one tape-block
  of the same size.  Amanda writes in chunks of 32Kbyte (tuneable
  in amanda.conf).
- when reading a tape with variable blocks, the read() syscall buffer
  should be equal or greater than the tape blocksize.  If smaller, you
  get, depending on the implementation, an error (ok, good!), or the
  first few bytes from each block that fits in the buffer (I've
  known some versions of HPUX doing this -- very weird when you're
  reading tapes!).
- when using fixed blocksize, you should always read/write in multiples
  of the physical tapeblocksize.
- when using fixed blocksize, depending on the implementation, you
  get back one physical block for each read() syscall, or the filled
  the readbuffer with an exact multiple of the tape blocksize.
- especially the last block of a tape can be handled different by
  the different implementations.  Is the last block padded with
  zero's, padded with garbage, or truncated -- I've read about all kinds
  if issues here.
- there is an interaction with opening a tape in bsd-mode or sysv-mode:
  what to do when you close() a nonrewinding tapedevice in the middle
  of a file; when opening again, do you the next block or the first
  block of the next tapefile?
  Is it a tape block or read()-buffer block.  When using variable
  blocksize the two are the same.
- Use any blocksize you want or find convenient, but you have to be
  consistent when reading it again.
- Not all tapedevice can be set in variable block; IIRC, a qic-tape
  always uses fixed 12 byte blocks.

Did I forget something?


--
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, *
* init 0, kill -9 1, Alt-F4, Ctrl-Alt-Del, AltGr-NumLock, Stop-A, ... *
* ...  "Are you sure?"  ...   YES   ...   Phew ...   I'm out          *
***********************************************************************