Well, since I was "fingered" below ;) here's what I intended to be a
config, in case you don't have it working yet.  I am working out of the
directory /etc/amanda/SMGDR0, with an ADIC SC100.  Comments below...

/etc/amanda/SMGDR0/amanda.conf (important stuff):
======================8<------------------------------------
tpchanger "chg-zd-mtx"  

tapedev "/dev/nst0"     (Or whatever no-rewind device you use)

changerfile "/etc/amanda/SMGDR0/ADIC" (I named it ADIC, but can be anything)
changerdev "/dev/sg2"  (whatever scsi-generic device the changer is)
======================8<------------------------------------

        The changerfile is just a word that is used to name files.
        Chg-zd-mtx will create files as such (using above ADIC example):

        ADIC-access
        ADIC-barcodes
        ADIC-clean
        ADIC-slot

You will need to create an ADIC.conf (again, ADIC is an example).  There
is a template located _within_ chg-zd-mtx (I'm not sure if the general
Amanda documentation has this added yet?), but it will look like this:


/etc/amanda/SMGDR0/ADIC.conf
======================8<------------------------------------
firstslot=2             #### 1st tape slot
lastslot=15             #### Last tape slot
cleanslot=1             #### Slot with cleaner tape

  # Do you want to clean the drive after a certain number of accesses?
  # NOTE - This is unreliable, since 'accesses' aren't 'uses', and we
  #        have no reliable way to count this. A single amcheck could
  #        generate as many accesses as slots you have, plus 1.
  # ALSO NOTE - many modern tape loaders handle this automatically.

AUTOCLEAN=0             #### Set to '1' or greater to enable

autocleancount=99       #### Number of access before a clean.

havereader=1            #### If you have a barcode reader, set to 1.

offlinestatus=1         #### Set to 0 if 'mt status' gives an
                        #### "offline" when drive is offline.
                        #### Set to 1 or greater if 'mt status'
                        #### doesn't give and offline, rather an
                        #### "ONLINE" when drive is online.

OFFLINE_BEFORE_UNLOAD=0 #### Does your tape driver require a
                        #### 'mt offline' before mtx unload?
======================8<------------------------------------

        All the items are needed, cause I'm a sucky programmer.  ;)
        The cleanslot can be anything, and it doesn't have to be outside the
        firstslot - lastslot range.  All that it means is "if a cleaning
        operation is called, where would the tape be".  If you only do the
        cleaning manually, you can otherwise use that slot for a regular
        tape, and swap it manually before calling the cleaning job, or
        whatnot.  Mine is set to 1, which is my mailslot, so I can feed it
        in without disturbing any tapes.


Hope this helps...      



On Tue, 26 Jun 2001, John R. Jackson wrote:

> >...  When I try to run amtape show I get 
> >errors.  Below is a dump of the logs from /tmp.  Any thoughts from anyone?
> 
> The "currently loaded slot = -1" seems to imply no tape is currently
> loaded, which "-slot current" does not appear to be handling.  In theory,
> it should have seen the "-1" and used "firstslot" from your config file.
> 
> The chg-zd-mtx script went through a large revision not long ago, so
> it's hard to know exactly what version you have.  The debug file you
> quoted implies 2.4.2p2, but you said you were using 2.4.2.
> 
> Here are a couple of suggestions:
> 
>   * See if you have this line in the comments at the start of the file:
> 
>       Modified by Jason Hollinden <[EMAIL PROTECTED]> on 13-Feb-2001
> 
>     That would indicate you have the latest version.  If you don't have
>     this version, get 2.4.2p2 from SourceForge and unpack it, then copy
>     just the chg-zd-mtx.sh.in file from it into whatever sources you're
>     working from (you might want to save the original, "just in case" :-).
>     Then "make" and "make install" to put it in place.
> 
>   * Try "amtape DailySet1 reset" and look at the changer debug file.
>     It should have a message like this:
> 
>       RESET -> loading tape from 1st slot ($firstslot) to $tape
> 
>     so you'll be able to see what firstslot is set to inside the
>     script.
> 
>     BTW, you probably should *not* put that trailing slash on the config
>     name.  It's not needed, and I've seen cases (can't remember where)
>     recently where using the trailing slash on a directory name led
>     to problems.
> 
>   * Add these lines at the start of the script:
> 
>       exec 2> /tmp/chg-zd-mtx.$$
>       set -x
> 
>     Find the loadslot() function and add the "set -x" to it as well.
> 
>     This will log a trace of all the statements to the file in /tmp and
>     hopefully we can see which one caused the "unary operator expected"
>     error, although I suspect it's related to the firstslot problem.
> 
> >And changer.conf
> >
> >firstslot=0             #### 1st tape slot
> >lastslot=7             #### Last tape slot
> >cleanslot=7             #### Slot with cleaner tape
> 
> This probably isn't related to your current problem, but I don't think
> you want lastslot to be 7.  It should be the last slot that has a "real"
> tape in it.  Slot 7 (apparently) has your cleaning tape, so lastslot
> should (I think) be 6.
> 
> John R. Jackson, Technical Software Specialist, [EMAIL PROTECTED]


--
   Jason Hollinden

   MH5 Systems Admin

Reply via email to