Amanda-Users

Re: Tape and disk mirror configuration

2003-02-11 18:31:24
Subject: Re: Tape and disk mirror configuration
From: Milos Brkic <mbrkic AT farelogix DOT com>
To: jrj AT purdue DOT edu
Date: Tue, 11 Feb 2003 16:42:38 -0500
John,
I have been away for ~week, and I am just getting back to this problem.

Thanks for the response, however, this is exactly what I have seen already. I need some more details on the procedure/process.

Here are some details on what I have done, and the behaviour that I get. If you need more info/details, please let me know the specifics. Otherwise, can someone tell me what I am missing?

In the amanda.conf:
===========================================================
...
runtapes 1              # number of tapes to be used in a single run of amdump
tapedev "rait:{file:/backups/current1,tape:/dev/rmt/0bn}"       # mirrored backups
rawtapedev "/dev/null"  # the raw device to be used (ftape only)

tapetype BIGDAT         # what kind of tape it is (see tapetypes below)
labelstr "^flxmth[0-9][0-9]*$"  # label constraint regex: all tapes must match
...
define tapetype BIGDAT {
    comment "BIGDAT tape drives"
    length 20000 mbytes         # these numbers are not accurate
    filemark 100 kbytes         # but you get the idea
    speed 100 kbytes
}
...


The rest of the config should be standard/irrelevant.
=============================================================
Here is what happens when I try to run amlabel:

amanda@matrix $ pwd
/backups/current1
amanda@matrix $ ls -la
total 18
drwxr-xr-x   7 amanda   amandagrp    512 Jan 30 14:58 .
drwxr-xr-x  12 root     sysadmin     512 Jan 27 17:38 ..
-rw-r--r--   1 amanda   amandagrp      0 Jan 30 14:58 am.log
lrwxrwxrwx   1 amanda   amandagrp      9 Jan 30 14:58 data -> flxmth005
drwxr-xr-x   2 amanda   amandagrp    512 Jan 28 09:43 flxmth001
drwxr-xr-x   2 amanda   amandagrp    512 Jan 28 12:11 flxmth002
drwxr-xr-x   2 amanda   amandagrp    512 Jan 30 12:39 flxmth003
drwxr-xr-x   2 amanda   amandagrp    512 Jan 30 14:48 flxmth004
drwxr-xr-x   2 amanda   amandagrp    512 Jan 30 14:58 flxmth005
-rw-------   1 amanda   amandagrp     11 Jan 30 14:53 info
amanda@matrix $ ls -l flxmth005
total 0
amanda@matrix $ more info
position 1
amanda@matrix $ ammt -t file:/backups/current1 rewind
amanda@matrix $ mt -t /dev/rmt/0bn stat
Vendor 'SEAGATE ' Product 'DAT    9SP40-00' tape drive:
   sense key(0x0)= No Additional Sense   residual= 0   retries= 0
   file no= 0   block no= 64
amanda@matrix $ mt -t /dev/rmt/0bn rewind
amanda@matrix $ amlabel -f flxmth flxmth005
rewinding, reading label, reading label: Error 0
rewinding, writing label flxmth005, checking label
amlabel: reading label: Error 0
amanda@matrix $ mt -t /dev/rmt/0bn stat
Vendor 'SEAGATE ' Product 'DAT    9SP40-00' tape drive:
   sense key(0x0)= No Additional Sense   residual= 0   retries= 0
   file no= 0   block no= 64
amanda@matrix $ ls -l flxmth005
total 132
-rw-------   1 amanda   amandagrp     10 Jan 30 15:01 00000-unknown
-rw-------   1 amanda   amandagrp  32768 Jan 30 15:01 00000.unknown
-rw-------   1 amanda   amandagrp     10 Jan 30 15:01 00001-unknown
-rw-------   1 amanda   amandagrp  32768 Jan 30 15:01 00001.unknown
amanda@matrix $ more info
position 2
position 2

====================================================================
This already seems wrong. Here is what happens when you then try to run an amdump:

amanda@matrix $ mt -t /dev/rmt/0bn rewind
amanda@matrix $ ammt -t file:/backups/current1 rewind
amanda@matrix $ amdump flxmth doom c0t0d0s3
amanda@matrix $ ls -l flxmth005
total 70340
-rw-------   1 amanda   amandagrp     10 Jan 30 15:01 00000-unknown
-rw-------   1 amanda   amandagrp  32768 Jan 30 15:01 00000.unknown
-rw-------   1 amanda   amandagrp     13 Jan 30 15:04 00001-unknown
-rw-------   1 amanda   amandagrp35946496 Jan 30 15:04 00001.unknown
amanda@matrix $ mt -t /dev/rmt/0bn stat
Vendor 'SEAGATE ' Product 'DAT    9SP40-00' tape drive:
   sense key(0x0)= No Additional Sense   residual= 0   retries= 0
   file no= 3   block no= 0

=====================================================================


Cheers,
Milos

John R. Jackson wrote:
I have seen a number of suggetstions that it is
possible to configure the rait driver to mirror
backups to disk and tape.  ...
    
That should be do-able.

  
Is there anyone out there that has this going that
can post their exact config and procedures? 
    
I'm not doing this locally, only during debugging (*), but the theory
goes like this.

The RAIT syntax usually looks something like this:

  rait:/dev/rmt/{0,1,2,3,4}n

The code parses that and expands the stuff in the curly braces so it
ends up using:

  /dev/rmt/0n
  /dev/rmt/1n
  /dev/rmt/2n
  /dev/rmt/3n
  /dev/rmt/4n

Now, the beauty of this is, the parsing code doesn't care where the
curly braces are.  And the second bit of magic is that the RAIT code
calls the generic "open a tape output driver" code for each item, not
the low level OS open() call.

So you can put any other type of output device you want inside a RAIT
specification (I think I even tried nesting a RAIT inside another RAIT
once, just for the heck of it).  If you want to use the following two
devices as a mirror:

  tape:/dev/rmt/0n
  file:/amanda/online/backups

you would set tapedev to:

  rait:{tape:/dev/rmt/0n,file:/amanda/online/backups}

(the "tape:" may be omitted since that's the default driver).

The only other thing you need to remember is that the tapetype length
value is a hard limit for the "file:" driver.  If you set it to, say,
10 GBytes, then when /amanda/online/backups gets to 10 GBytes it will
report an error back upline to emulate end of tape.  If you're using
tapes that hold 20 GBytes, they will only be half utilized since an
error on any device during RAIT processing closes all of the devices.

Does that help?

  
Milos
    
John R. Jackson, Technical Software Specialist, jrj AT purdue DOT edu

(*)  During debugging of the RAIT code (actually, the integration of
what Marc provided with how I wanted to do the output drivers), I could
simulate a "failed" tape by inserting "null:" for one of the devices.
I was also using multiple "file:" devices for the I/O -- I've never
actually used RAIT on real tapes :-).

  rait:{file:/tmp/part0,file:/tmp/part1,null:,file:/tmp/part3,file:/tmp/part4}

This made debugging pretty neat (which shows you how geeky I can get :-),
but it was also a wonder to behold the first time the code regenerated
the input exactly the way it should.  Of course, I'm still amazed I
get back 2 when I ask a computer to add 1 and 1 (and you would be, too,
if you knew what all the little transistors went through :-).

Note -- this is from memory and I may not have the syntax exactly right,
but the technique does work this way in general.
  

<Prev in Thread] Current Thread [Next in Thread>
  • Re: Tape and disk mirror configuration, Milos Brkic <=