>First, some background... I'm using a 22-tape changer on a linux box, and
>using two tapes per run...

What that really means is that you will use **up to** two tapes per run.
If what you have to back up fits on one tape (for whatever reason),
Amanda will only use one tape.

>dumpcycle 2 weeks
>runspercycle 10
>tapecycle 22 tapes
>runtapes 2

OK.

>Now, I run amcheck and amdump in a cron job M-F for 2 weeks. That's 20
>tapes with 2 tapes for error.  ...

Up to 20 tapes.

>I've labeled all the tapes daily-01 through
>daily-22 on the cartridge that's in the tape machine now.  ...

OK.

>- I assume amdump will grab a new tape when it needs it... ie, the first
>  dump is on daily-01 and daily-02. I don't manually need to advance to
>  daily-03 for tonights dump.

Correct.  It will first read the label on the "current" tape.  If that
tape is active (e.g. from last night), it will use the changer to
advance to the "next" tape and keep doing that until it finds one it is
happy with.  What "current" and "next" mean are up to your changer.

Amanda leaves the last tape it uses in the drive.  You might want to put
an "amtape <config> slot advance" after each run to go ahead and unload it
and tell the changer what will be used next without actually loading it.
That will save a label check and unload on the next run, and gets the
tape out of the drive where it has the potential of being damaged.

>- At the end of the second week, do I swap a new set of 22 tapes in, or
>  can I start reusing daily-01? I'm not entirely clear on how this works,
>  as it's a little different than anything I've ever used. If I start
>  reusing, do I risk losing data?

This depends on what you have available to work with and what you're
trying to do.

Amanda has no concept of cartridges (sets of tapes).  At some point
we need to teach it about this common hardware feature, but it's not
there now.  Amanda sees all of your tapes as a big pool and wants to
move through that pool in order.

If you didn't have any more tapes/cartridges, you could just leave
Amanda alone and after it got through the first 22 tapes it would wrap
back around to daily-01.  As long as tapecycle > dumpcycle, you should
not loose any data (although a common trick is to set dumpcycle so at
least two cycles fit in tapecycle).

If you plan to remove a set of tapes (cartridge) on some schedule and
drop in the next set, and you want Amanda to know about all of the sets
(i.e. so if you did a restore it told you what set as well as the tape
within the set), the first thing I'd do is use a different label scheme
that includes the cartridge, e.g. Daily-CC-TT where "CC" is a cartridge
number and "TT" is the tape within that cartridge.  This is just a human
thing (Amanda doesn't care), but it might make finding tapes easier.

Now you need to get Amanda to accept the tapes in the order you present
them.  I played with this all afternoon and came up with the following
that seemed to work (although I was only doing rough testing).

  * Lie to Amanda about the tapecycle.  Normally, you should tell it
    the truth about how many tapes you really have.  For instance, if
    you have 4 cartridges of 22 tapes, you would set tapecycle to 88.
    In the method I came up with, I lied and just told it about one
    cartridge (22 in your case).

    This will bite you in the following ways:

      + amadmin <config> balance will not be right (probably not a
        big deal).

      + Fewer amflush.<NN> and amdump.<NN> log files will be kept (the
        number is based on tapecycle).  May or may not be important.

      + Index files (catalogues) will be thrown away too soon.  This
        is serious and you may need to hack amtrmidx.c to multiply
        tapecycle by the number of cartridges you have, or something
        like that.  Using a larger number should not be a problem,
        it just keeps files around longer.

      + Log files (log.YYYYMMDD.NN) will be thrown away too soon.  This
        is also a problem and amtrmlog.c may need the same hack.  Again,
        using a larger number should not be a problem.

      + Possibly some other things I could not dig deep enough into
        the code to discover.

    You might also use the minimum tapes used in a cartridge (10 in your
    case) times the number of cartridges.  I think that would work out
    just as well (better, in the two cases above where a smaller number
    is a problem).

  * Make sure whatever changer you are using tells Amanda it is a gravity
    stacker, i.e. it cannot go backwards.  If Amanda thinks it can go
    backwards, it will search all labels for what it wants (an "exact
    match") rather than taking the first one that would work ("first
    labelstr match").

  * Go ahead and work your way through the first cartridge.  To swap it
    out for the next one, mark any left over tapes as "no-reuse" with
    amadmin, then put the new cartridge in and Amanda should go ahead
    at the beginning of it.

  * Ditto for the other cartridges.

  * When you loop back to the first cartridge, change the "no-reuse"
    tapes for just that cartridge back to "reuse" with amadmin.
    Amanda should then accept any of the tapes in the cartridge.

Sorry this is so messy.  As I said, someone needs to teach Amanda about
sets of tapes (this same concept comes up with sets of tapes in the
cycle that are taken off site), but it going to take some thought to come
up with the right paradigm.  What does "tapecycle" really mean?  Do we
need a new "available"/"not available" tape flag ala "reuse"?  How much
code that currently uses tapecycle needs to change to something else?
And what does it change to?

John R. Jackson, Technical Software Specialist, [EMAIL PROTECTED]

Reply via email to