In the files, chg-manual and chg-mtx there is a function in the code 
labelled loadslot(). In this funciton the dd command is used to look 
at the tape.

I have excerpted some code from chg-mtx, below...

This appears to be post-processing code following that event wherein a
tape is newly inserted into the drive...

Here are my questions:
----------------------

1)  Is this entire section concerned with determining if the next 
tape is the cleaning tape? IOW, is the purpose of the DD to see if we 
are reading a cleaning tape?

3)  Also, when next-tape equals first-tape, what does AMANDA *want to 
do* when asked to write over the first tape in the magazine?

4)  I downloaded, built, and installed mtx-1.2.16rel, the SCSI 
control program available at SourceForge. I could not find certain 
options that are used in the chg-mtx below. For example, these 
options I do not find: -l, -u. Does anyone know the actions implied 
by:

        mtx -u
        mtx -l



Thank for any and all advice... I appreciate your time...

J


#############################
## from 3b3/libexec/chg-mtx
#############################

     # Slot 6 might contain an ordinary tape rather than a cleaning
     # tape. A cleaning tape auto-ejects; an ordinary tape does not.
     # We therefore have to read the status again to check what
     # actually happened.
     readstatus


     if [ $used -gt 0 ];then
       echo "     -> unload $used" >> $logfile
       res=`$MTX -u $used`
       status=$?
       echo "     -> status $status" >> $logfile
       echo "     -> res    $res" >> $logfile
       if [ $status -ne 0 ];then
         answer="<none> $myname: $res"
         code=2
         echo "Exit -> $answer" >> $logfile
         echo "$answer"
         exit $code
       fi
     fi
     if [ $whichslot = advance ];then
       answer="$load /dev/null"
       code=0
       echo "Exit -> $answer" >> $logfile
       echo "$answer"
       exit $code
     fi
     echo "     -> load   $load" >> $logfile
     res=`$MTX -l $load`
     status=$?
     echo "     -> status $status" >> $logfile
     echo "     -> res    $res" >> $logfile
     if [ $status -eq 0 ];then
       echo "     -> rew $load" >> $logfile
       $MT $MTF $tape rewind
       $DD if=$tape bs=32k count=1 >> $logfile 2>&1
       answer="$load $tape"
       code=0
     else
       answer="$load $res"
       code=2
     fi
     echo "Exit -> $answer" >> $logfile
     echo "$answer"
     exit $code

#######

Reply via email to