Re: Barcode support outside of chg-scsi

2001-02-02 Thread Jason Hollinden

Ok, I'm a few steps closer to adding barcode support to a modified chg-zd-mtx
script.  I have a two questions for some people in the know.

chg-scsi has the following params:
  ./chg-scsi-slot 
  ./chg-scsi-info
  ./chg-scsi-reset
  ./chg-scsi-eject
  ./chg-scsi-clean
  ./chg-scsi-label 
  ./chg-scsi-search 
  ./chg-scsi-status 
  ./chg-scsi-trace 

I know the first 4, as they are documented in the TAPE.CHANGERS file.  I've
mostly figured out what -label  does, but to be sure I'm pretending to 
not.  

My question is, what do the last 5 items do?  By that I mean, what do they 
pass to the changer script, and what do they expect as return values.  For
instance, I "believe" that -label's  is the amlabel of the current tape.
The changer script puts that, and the barcode, into a file, then returns 
"0 0 0" if it worked.  If it fails, it returns the slot, and the tape device.

Also, what is the format that amtape needs the barcode file to be in?  Just for
testing I have it as:

 
 
 
...

Thanks...

--
   Jason Hollinden

   SMG Systems Admin



Re: Barcode support outside of chg-scsi

2001-02-02 Thread Doug Munsinger

Jason -

Yes -
[amanda@ford amanda]$ amtape daily slot 13
amtape: could not load slot 0: illegal request

But with the change in code this now works.

Much thanks for pointing this out.

--doug

At 08:04 AM 2/2/2001 -0500, you wrote:


>On Fri, 02 Feb 2001, Doug Munsinger wrote:
>
> > I'm testing that test case - so far I hadn't had any trouble with that, 
> but
> > my testing may have stepped around it.
>
>I didn't notice it until I did an 'amtape  slot #'.  I was only testing
>with next, prev, current, etc for the longest time.
>
>
>--
>Jason Hollinden
>
>SMG Systems Admin





Doug Munsinger

egenera, Inc.
[EMAIL PROTECTED]
563 Main Street, Bolton, MA  01740
Tel: 508-786-9444 ext. 2612
OR 508-481-5493
fax: 978 779-9730




Re: Barcode support outside of chg-scsi

2001-02-01 Thread Jason Hollinden

That's essentially the same things I had to do, the timeout and the changing of
the wording returned from mtx.  The only other thing I had to change was the 
case test at line that read:

[$firstslot-$lastslot])
  load=$1
  ;;

Because of the wording of the [test]), the highest slot number you can have
would be 9.  Since I have 30, I had to change it to the below:

   $[${whichslot}])

   if [ $whichslot -gt $lastslot ] || [ $whichslot -lt $firstslot ]; then
   echo "0 Slot $whichslot is out of range ($firstslot - $lastslot)"
   exit 1
   else
   loadslot=$whichslot
   fi
   ;;


This was because if your $lastslot > 9, the test doesn't work right.  For me,
$lastslot is 30, so the test was saying " [1-30]) which is "1-3 _or_ 0" in 
shell pattern matching.  It took me forever to notice this, and I pulled some
hair out wondering why I couldn't load a tape higher than slot 3.

Thanks...

On Thu, 01 Feb 2001, Doug Munsinger wrote:

> Jason -
> 
> having just been through "changer hell" I'm copying some mail I just sent 
> to Joe Rhett re: chg-zd-mtx and barcodes -
> MAYBE it will help resolve what you are going through now.
> 
> I fought with chg-scsi and chg-zd-mtx for about a week before dropping back 
> and getting chg-manual to fully work first.
> 
> Here's what I just finished:
> Hope this helps.
> 
> --doug
> 
> ___
> 
> 
> Joe -
> 
> I downloaded the improved mtx script from the link you gave in this post -
> MUCH THANKS as the site also gave specific instructions for placing
> at /client-src/chg-zd-mtx.sh.in
> and then run configure.  This came very close to working as is.
> 
> The timing worked well as I was already re-installing 2.4.2p1 upgrades 
> anyway...
> 
> I found two flaws in the code for my specific tape drive and changer.
> I have an Ecrix VXA autopak library with a single Ecrix VXA tape unit 
> installed - with a barcode reader.
> 
> I managed to get chg-manual running consistently and getting good backups 
> first, which let me know that the tape drive and amanda were doing well, 
> before attempting for a second time to get the changer to cooperate.
> I also installed mtx 1.2.10 and tested and verified this would work... So 
> at least I could get an e-mail that the tape needed changing and then log 
> in and accomplish that from home...
> 
> What I changed to make the chg-zd-mtx script work was to add a TIMEOUT 
> variable to use in a sleep command in loadslot as follows:
>  # Now rewind and check
>  echo " -> rewind $loadslot" >> $DBGFILE
>  echo " -> sleeping TIMEOUT: $TIMEOUT 
> seconds..." >> $DBGFILE
>  sleep $TIMEOUT
>  echo " -> rewind..." >> $DBGFILE
>  $MT $MTF $tape rewind
>  echo "$loadslot" > $slotfile
>  echo "$loadslot $tape"
>  exit 0
> 
> Otherwise I would consistently get
> "/dev/nst0: Input/output error"
> on any rewind or tape change by the script
> 
> This MOSTLY allowed the script to work, except -
> I have a barcode reader.
> The result of an mtx status command with a barcode reader is different than 
> without - at least when the tapes have barcodes -
> here's what the mtx -f /dev/sg1 status result looks like (with barcode)
> 
> Data Transfer Element 0:Full (Storage Element 11 Loaded):VolumeTag = 09
>Storage Element 1:Full :VolumeTag=00
>Storage Element 2:Full :VolumeTag=01
>Storage Element 3:Full :VolumeTag=02
>Storage Element 4:Full :VolumeTag=03
>Storage Element 5:Full
>Storage Element 6:Full
>Storage Element 7:Full
>Storage Element 8:Full
>Storage Element 9:Full
>Storage Element 10:Full
>Storage Element 11:Empty
>Storage Element 12:Full
>Storage Element 13:Full
>Storage Element 14:Full
>Storage Element 15:Full
> 
> which caused the sed command to give back:
> [amanda@ford amanda]$ mtx -f /dev/sg1 status | sed -n 's/Data Transfer 
> Element 0:Empty/-1/p;s/Data Transfer Element 0:Full (Storage Element \(.\) 
> Loaded)/\1/p'
> 1:VolumeTag = 00
> which won't work...
> 
> here's the change:
> readstatus() {
>  EMP_FULL=`$MTX status | grep "Data Transfer Element" | awk '{ 
> print $4 }' | awk -F: '{print $2 }'`
>  if [ $EMP_FULL = "Empty" ]; then
>  usedslot="-1"
>  fi
>  if [ $EMP_FULL = "Full" ]; then
>  usedslot=`$MTX status | grep "Data Transfer Element" | awk 
> '{ print $7 }'`
>  fi
> 
> 
> I'll include the full script below this.
> 
> I thought this might come in handy and might also be something you would 
> want to include in the upkeep of chg-zd-mtx.
> 
> --doug
> 
> Doug Munsinger
> 
> egenera, Inc.
> [EMAIL PROTECTED]
> 563 Main Street, Bol

Re: Barcode support outside of chg-scsi

2001-02-01 Thread Doug Munsinger

Jason -

having just been through "changer hell" I'm copying some mail I just sent 
to Joe Rhett re: chg-zd-mtx and barcodes -
MAYBE it will help resolve what you are going through now.

I fought with chg-scsi and chg-zd-mtx for about a week before dropping back 
and getting chg-manual to fully work first.

Here's what I just finished:
Hope this helps.

--doug

___


Joe -

I downloaded the improved mtx script from the link you gave in this post -
MUCH THANKS as the site also gave specific instructions for placing
at /client-src/chg-zd-mtx.sh.in
and then run configure.  This came very close to working as is.

The timing worked well as I was already re-installing 2.4.2p1 upgrades 
anyway...

I found two flaws in the code for my specific tape drive and changer.
I have an Ecrix VXA autopak library with a single Ecrix VXA tape unit 
installed - with a barcode reader.

I managed to get chg-manual running consistently and getting good backups 
first, which let me know that the tape drive and amanda were doing well, 
before attempting for a second time to get the changer to cooperate.
I also installed mtx 1.2.10 and tested and verified this would work... So 
at least I could get an e-mail that the tape needed changing and then log 
in and accomplish that from home...

What I changed to make the chg-zd-mtx script work was to add a TIMEOUT 
variable to use in a sleep command in loadslot as follows:
 # Now rewind and check
 echo " -> rewind $loadslot" >> $DBGFILE
 echo " -> sleeping TIMEOUT: $TIMEOUT 
seconds..." >> $DBGFILE
 sleep $TIMEOUT
 echo " -> rewind..." >> $DBGFILE
 $MT $MTF $tape rewind
 echo "$loadslot" > $slotfile
 echo "$loadslot $tape"
 exit 0

Otherwise I would consistently get
"/dev/nst0: Input/output error"
on any rewind or tape change by the script

This MOSTLY allowed the script to work, except -
I have a barcode reader.
The result of an mtx status command with a barcode reader is different than 
without - at least when the tapes have barcodes -
here's what the mtx -f /dev/sg1 status result looks like (with barcode)

Data Transfer Element 0:Full (Storage Element 11 Loaded):VolumeTag = 09
   Storage Element 1:Full :VolumeTag=00
   Storage Element 2:Full :VolumeTag=01
   Storage Element 3:Full :VolumeTag=02
   Storage Element 4:Full :VolumeTag=03
   Storage Element 5:Full
   Storage Element 6:Full
   Storage Element 7:Full
   Storage Element 8:Full
   Storage Element 9:Full
   Storage Element 10:Full
   Storage Element 11:Empty
   Storage Element 12:Full
   Storage Element 13:Full
   Storage Element 14:Full
   Storage Element 15:Full

which caused the sed command to give back:
[amanda@ford amanda]$ mtx -f /dev/sg1 status | sed -n 's/Data Transfer 
Element 0:Empty/-1/p;s/Data Transfer Element 0:Full (Storage Element \(.\) 
Loaded)/\1/p'
1:VolumeTag = 00
which won't work...

here's the change:
readstatus() {
 EMP_FULL=`$MTX status | grep "Data Transfer Element" | awk '{ 
print $4 }' | awk -F: '{print $2 }'`
 if [ $EMP_FULL = "Empty" ]; then
 usedslot="-1"
 fi
 if [ $EMP_FULL = "Full" ]; then
 usedslot=`$MTX status | grep "Data Transfer Element" | awk 
'{ print $7 }'`
 fi


I'll include the full script below this.

I thought this might come in handy and might also be something you would 
want to include in the upkeep of chg-zd-mtx.

--doug

Doug Munsinger

egenera, Inc.
[EMAIL PROTECTED]
563 Main Street, Bolton, MA  01740
Tel: 508-786-9444 ext. 2612
OR 508-481-5493
fax: 978 779-9730





At 03:54 PM 1/31/2001 -0800, Joe Rhett wrote:
>Are you using the latest MTX version?
>
>Is the problem mtx itself? (Can you run "mtx load x", "mtx unload x" etc?
>
>Or is the problem with the changer script? Are you using the latest
>version? You can get it at
> http://www.noc.isite.net/?Projects
>
>On Wed, Jan 31, 2001 at 07:32:44PM -, [EMAIL PROTECTED] 
>wrote:
> > I'm new to amanda and really can use some help installing a new
> > changer. The new unit is a Overland Minilibrary (15-slot) with 1
> > DLT-7000 drive. Our old unit is working fine but our filesystems have
> > grown a lot. The new unit is a model 7115.
> >
> > The problem appears to be my mtx configuration. Any help is greatly
> > appreciated!!!
> >
> > Sam Lauro
>
>--
>Joe Rhett Chief Technology Officer
>[EMAIL PROTECTED]  ISite Services, Inc.
>
>PGP keys and contact information:  http://www.noc.isite.net/Staff/


Full revised chg-zd-mtx script:

#!/bin/sh
#
# Exit Status:
# 0 Alles Ok
# 1 Illegal Request
# 2 Fatal Error
#
# Contributed by Eric DOUTRELEAU <[EMAIL

Barcode support outside of chg-scsi

2001-02-01 Thread Jason Hollinden

After several days of searching, reading, and cussing, I am posting my woes
in the hopes someone has some insight to using barcodes.

Just for background, I have a Dell Poweredge-2400 with RedHat 6.2, running 
amanda-2.4.2p1.  My tape library is an ADIC Scalar 100 hanging off a dedicated 
Adaptec 2944UW.  All my tapes have been labeled using amlabel.  I only have
8 tapes (and a cleaning tape resting in the last slot), as you will see in the
attached configs, as it takes way too long to index 30 tapes.

That said, I'm having trouble with several different paths.  I have about 60% 
sucess with chg-scsi, and 90% success with chg-zd-mtx (using mtx-1.2.10-1).  

chg-scsi problems:

Using this glue script, I can do all of the "tape movement only" functions, 
such as amtape's eject, reset, and slot .  Where it fails is 
any activity where it has to load tapes and 'quickly' read from them, such as 
amtape's update, label, and show commands.  The problem is that amtape is not 
giving my library enough time to load up the tape, despite whatever the sleep 
setting in my chg-scsi.conf file is set to.  I've pretty much confirmed this
with the fact that I can run the same command again after the tape is 
completely loaded, and the amlabel shows up fine.  Here's an example:

### Ran with no tape in the drive

bash-2.03$ /usr/sbin/amtape Reubens current
amtape: scanning current slot in tape-changer rack:
slot 0: rewinding tape: Input/output error

### This loads a tape from slot 0, but doesn't wait for it to finish winding
### Next is the exact same command, after it's done winding

bash-2.03$ /usr/sbin/amtape Reubens current
amtape: scanning current slot in tape-changer rack:
slot 0: date Xlabel Reubens01

###

Because of this, I can't get the bardcodes from the tapes to do much of
anything.  Chg-scsi will populate my barcode file with just the tape loaded, 
but when I need to index all the tapes with 'amtape Reubens update' it has no
data, since it doesn't sleep until the tape is ready.  My sleep statement has
been everything from 120 - 1200 sec. but I don't believe that is what it is 
supposed to do, anyways.

chg-zd-mtx problems:

Actually, I have very few problems with this, except that there is no barcode
work done with it.  I had to modify it to work with > 9 slots, and can post
that if someone wants.  The main problem is no barcode support.  The version of
mtx I have reports the barcodes, so modifying this glue script some more to use
them shouldn't be too much trouble.

This is where I finally start getting to my point...

How does Amanda utilize barcodes?  Are there any Amanda commands that directly
mess with barcodes, or is the only thing that has anything to do with them the
changer glue script, and it just so happens that only chg-scsi looks at them
right now?  If it's the second, I'm about a few days away from writing a 
chg-zd-mtx variant with an "internal" barcode matching system.

I'm attaching about everything I've seen on this group as a usable file for
cases like this, and if there is anything I've missed, please tell me.  If, 
after looking through my stuff, it looks like a simple fix for chg-scsi on my 
part for it to work correctly, that's great.

A quick list of attachments:

- amanda.conf
- ADIC.conf   (chg-scsi script)
- status-all.txt   (running chg-scsi -status all)

# below 3 were done with no tape in the drive, and 8 in the slots
- chg-scsi.debug.update   (generated after running 'amtape Reubens update')
- amtape.debug.update   (generated after running 'amtape Reubens update')
- update.txt   (what 'amtape Reubens update' spat to the screen)

# outputs from 'amtape Reubens slot current' with tape in drive
- chg-scsi.debug.current
- amtape.debug.current
- current.txt   (paste from the screen)

--
   Jason Hollinden

   SMG Systems Admin

 amanda-problems.tar.gz