Amanda-Users

Re: Issues with tape changers

2004-07-14 11:53:05
Subject: Re: Issues with tape changers
From: Gene Heskett <gene.heskett AT verizon DOT net>
To: amanda-users AT amanda DOT org
Date: Wed, 14 Jul 2004 11:48:19 -0400
On Wednesday 14 July 2004 08:45, Gaby Vanhegan wrote:
>Hi,
>
>First of all, I'd like to apologise for the cross post, but this has
>been knacking me off for 2 weeks now, and I really want to get this
>sorted... :)
>
>Having some minor issues with Amanda on OpenBSD3.4, talking to a
> Dell Powervault 120T 7-slot changer/drive.  After eventually
> working my way through the changer scripts I've found that chg-chio
> is the one for me. chg-scsi, couldn't figure out the configuration
> files and couldn't take to the jukebox, but chg-chio, using the
> chio program works fine.
>
>The issue that I have now is that I'm finding amtape unreliable at
>moving tapes around effectively, and also that it's having problems
>rewinding tapes.  I don't know if this is an OpenBSD related issue
> or an Amanda issue.  I'm using the latest release version that I
> could find on the site (amanda-2.4.4p3) compiled from source.
>
>Using chio to move tapes between slots works perfectly, so I don't
> think it's a changer issue, and I can't find any mention of the
> error messages in the changer code.  It looks like it's having some
> issues with regards to rewinding the tapes, and not handling the
> time that the tape would take to rewind.  In my configuration, it
> seems that the taper has no method of handling the fact that the
> drive is not ready, and just returns a file handle open error on
> /dev/nrst0.  I suppose that I would either need to know how to get
> the Dell Powervault 120T working under the chg-scsi driver, or some
> means of adding a delay into the process to allow the drive to
> ready itself before letting ammt get anywhere near /dev/nrst0.
>
>My configuration is called ltsn.  Here is an example of what happens
>when changing a tape around:
>
>bash-2.05b# /usr/local/sbin/amtape ltsn slot first
>amtape: could not rewind /dev/nrst0: tape_rewind: tape open:
> /dev/nrst0: Input/output erroramtape: changed to slot 1 on
> /dev/nrst0
>
>bash-2.05b# cat /tmp/amanda/amtape.20040714123758.debug
>amtape: debug 1 pid 30456 ruid 0 euid 0: start at Wed Jul 14
> 12:37:58 2004 changer: got exit: 0 str: 2 /dev/nrst0
>amtape: pid 30456 finish time Wed Jul 14 12:39:05 2004
>
>bash-2.05b# cat /tmp/amanada/changer.debug
>Wed Jul 14 12:43:30 2004: enter: getTapeParams
>Wed Jul 14 12:43:30 2004: running: /bin/chio -f /dev/ch0 params
>Wed Jul 14 12:43:30 2004: /dev/ch0: 7 slots, 1 drive, 1 picker
>Wed Jul 14 12:43:30 2004: /dev/ch0: current picker: 0
>Wed Jul 14 12:43:30 2004: leave: getTapeParams: 7, 1, 1
>Wed Jul 14 12:43:30 2004: enter: getTapeStatus
>Wed Jul 14 12:43:30 2004: running: /bin/chio -f /dev/ch0 status
>Wed Jul 14 12:43:31 2004: picker 0:
>Wed Jul 14 12:43:31 2004: slot 0: <ACCESS,FULL>
>Wed Jul 14 12:43:31 2004: slot 1: <ACCESS>
>Wed Jul 14 12:43:31 2004: slot 2: <ACCESS,FULL>
>Wed Jul 14 12:43:31 2004: slot 3: <ACCESS,FULL>
>Wed Jul 14 12:43:31 2004: slot 4: <ACCESS,FULL>
>Wed Jul 14 12:43:31 2004: slot 5: <ACCESS,FULL>
>Wed Jul 14 12:43:31 2004: slot 6: <ACCESS,FULL>
>Wed Jul 14 12:43:31 2004: drive 0: <ACCESS,FULL>
>Wed Jul 14 12:43:31 2004: enter: getCurrentTape
>Wed Jul 14 12:43:31 2004: leave: getCurrentTape: 2
>Wed Jul 14 12:43:31 2004: leave: getTapeStatus: 7
>Wed Jul 14 12:43:31 2004MT -> /usr/local/sbin/ammt -f /dev/nrst0
> rewind Wed Jul 14 12:43:31 2004: enter: changeTape: 1
>Wed Jul 14 12:43:31 2004: enter: Unload: 2
>Wed Jul 14 12:44:13 2004: leave: Unload
>Wed Jul 14 12:44:13 2004: enter: Load: 1
>Wed Jul 14 12:44:13 2004: running: /bin/chio -f /dev/ch0 move slot 0
> drive 0 Wed Jul 14 12:44:37 2004: leave: Load
>Wed Jul 14 12:44:37 2004: leave: changeTape
>Wed Jul 14 12:44:37 2004: 1 /dev/nrst0
>
>bash-2.05b# chio status
>picker 0:
>slot 0: <ACCESS>
>slot 1: <ACCESS,FULL>
>slot 2: <ACCESS,FULL>
>slot 3: <ACCESS,FULL>
>slot 4: <ACCESS,FULL>
>slot 5: <ACCESS,FULL>
>slot 6: <ACCESS,FULL>
>drive 0: <ACCESS,FULL>
>
>Whilst the drive is not ready, this message appears in the dmesg:
>
>st0(ahc1:3:0): Check Condition on opcode 0x0
>    SENSE KEY: Not Ready
>     ASC/ASCQ: Logical Unit Is in Process Of Becoming Ready
>
>And ammt returns this:
>
>bash-2.05b# /usr/local/sbin/ammt -d -f /dev/nrst0 status
>debug mode!
>syntax: eof                  -> e
>syntax: weof                 -> w
>syntax: fsf                  -> f
>syntax: asf                  -> a
>syntax: bsf                  -> b
>syntax: rewind               -> rewi
>syntax: offline              -> o
>syntax: rewoffl              -> rewo
>syntax: status               -> s
>tapename is "/dev/nrst0"
>calling tape_open("/dev/nrst0",0)
>/dev/nrst0 status failed: Input/output error
>
>Eventually, the tape comes online and can be used, after about 30
> seconds:
>
>bash-2.05b# /usr/local/sbin/ammt -d -f /dev/nrst0 status
>debug mode!
>syntax: eof                  -> e
>syntax: weof                 -> w
>syntax: fsf                  -> f
>syntax: asf                  -> a
>syntax: bsf                  -> b
>syntax: rewind               -> rewi
>syntax: offline              -> o
>syntax: rewoffl              -> rewo
>syntax: status               -> s
>tapename is "/dev/nrst0"
>calling tape_open("/dev/nrst0",0)
>processing status(1)
>calling tapefd_status()
>/dev/nrst0 status: ONLINE ds == 0x0003 er == 0x0000
>
>Gaby

This is the same problem that has bugged me for 2-3 years,
its been mentioned on this list several times, and generally
ignored.

I used chg-scsi, which isn't that hard to setup, and it
worked when the drive worked (mine died about a month back
and has not been replaced, but will be, with dvd-+rw eventually),
except for rewinding, if I had run amcheck in order to
make it load the right tape beforehand, then I had to
cron-script a rewind command using mt before the amdump
session started since amcheck reads the label and leaves it
sitting at block 1 when its done.  If it was sitting on block 1,
then amdump never tried to rewind it, it just read the next block,
not finding the label, so it went into degraded mode.

This was also true of amcheck, if the tape it wanted was
loaded, mt must be used to rewind it before amcheck was
run else the lack of a functioning rewind caused it to
error and cycle thru to the next tape, trying the rest
of the magazine and finding all those labels just fine,
but not recheck the one it started on.  A re-run of
amcheck would then find the label correctly
because the act of ejecting the tape forces the _drive_
to rewind before it ejects. Then, when that tape is
reloaded, the label is found correctly, but is not
rewound, and this must be done by mt before the amdump
run starts else amdump gets a tummy ache, as noted above.

I consider it a bug, of VERY long standing duration.

Now, the confusion in setting up chg-scsi seems to be mainly
centered around how you specify the tape device, both in
amanda.conf and in chg-scsi.conf.  Or at least that was the
source of my confusion early on.

If useing chg-scsi, then the tape device in the amanda.conf is
specified by a number, not a device, and this number is used to
lookup that profile in chg-scsi.conf.  chg-scsi.conf can hold
more than one drives profile, starting with a base zero 0.

Some applicable snippets from my amanda.conf:
------------
autoflush yes
 
# At most one changerfile entry must be defined; select the most
# appropriate one for your configuration.  If you select man-changer,
# keep the first one; if you decide not to use a tape changer, you may
# comment them all out.

runtapes 1              # number of tapes to be used in a single run of amdump
tpchanger       "chg-scsi"      # the tape-changer glue script
tapedev         "0"     # the no-rewind tape device to be used
changerfile     "/usr/local/etc/amanda/DailySet1/chg-scsi.conf"
tapetype DDS2   # what kind of tape it is (see tapetypes below)
amrecover_do_fsf yes            # amrecover will call amrestore with the
                                # -f flag for faster positioning of the tape.
amrecover_check_label yes       # amrecover will call amrestore with the
                                # -l flag to check the label.
amrecover_changer "chg-scsi"   # amrecover will use the changer if you restore
#amrecover_changer  "chg-mtx"    # from this device.
----
And I'll leave this in as it formats your reports much nicer than
the stock entry for columnspec:
----
# The format for a ColumnSpec is a ',' seperated list of triples.
# Each triple consists of
#   + the name of the column (as in ColumnNameStrings)
#   + prefix before the column
#   + the width of the column, if set to -1 it will be recalculated
#     to the maximum length of a line to print.
# Example:
#       "Disk=1:17,HostName=1:10,OutKB=1:7"
# or
#       "Disk=1:-1,HostName=1:10,OutKB=1:7"
#        
# You need only specify those colums that should be changed from
# the default. If nothing is specified in the configfile, the
# above compiled in values will be in effect, resulting in an
# output as it was all the time.
# The names of the colums are:
# HostName, Disk, Level, OrigKB, OutKB, Compress, DumpTime, DumpRate,
# TapeTime and TapeRate.
#       ElB, 1999-02-24.
# Warning, one loooong line.
columnspec 
"Disk=1:18,HostName=0:10,Level=1:3,OrigKB=1:9,OutKB=1:9,Compress=1:7,DumpTime=1:7,DumpRate=1:7,TapeTime=1:7,TapeRate=1:7"


As follows from my chg-scsi.conf for a ctl-96 drive which has
only one profile:
-------------
number_configs  1
eject           0       # Tapedrives need an eject command
sleep           60      # Seconds to wait until the tape gets ready
cleanmax        100     # How many times could a cleaning tape get used
scsitapedev     /dev/sg0 # test entry per Jean-Louis request
changerdev      /dev/sg1
debuglevel      9:0
#
# Next comes the data for drive 0
#
config          0 #<--this is the tapedev 0 in amanda.conf
drivenum        0
dev             /dev/nst0       # the device that is used for the tapedrive 0
startuse        0       # The slots associated with the drive 0
enduse          3       # 
statfile        /usr/local/etc/amanda/tape-slot  # The file where the actual 
slot is stored
#cleancart      3       # the slot where the cleaningcartridge for drive 0 is 
located
#cleanfile      /usr/local/etc/amanda/tape-clean # The file where the cleanings 
are recorded
usagecount      /usr/local/etc/amanda/totaltime

# This is the end
------------------

Hopefully, this will clarify things a wee bit.

-- 
Cheers, Gene
There are 4 boxes to be used in defense of liberty. 
Soap, ballot, jury, and ammo.
Please use in that order, starting now.  -Ed Howdershelt, Author
Additions to this message made by Gene Heskett are Copyright 2004, 
Maurice E. Heskett, all rights reserved.

<Prev in Thread] Current Thread [Next in Thread>