Hello all,
I can’t get bacula to autoload tapes in the autochanger.  I’ve read through a 
few months of the
archives, but I can’t sort out my issue from the previous issues that have been
reported.  BTW, I just started this job
and am trying to pick up where the previous admin left off.  I’ve been able to 
get through about 5 tapes
of full backup by manually loading and mounting the tapes.  That is, the jobs 
are working fine, but the
jobs are much bigger than the tapes… and bacula won’t change the tapes itself.


 


Bacula: 1.38.5  (run as root)


RHEL4


 


 


We have a
11 slot LTO3 changer with no barcodes on the tapes.


I’ve
manually labeled all of the tapes in bconsole (via mtx /dev/sg8 load 1,  then 
label.)


My
changer.volumes


1:F06T06


2:F06T07


3:F06T08


4:F06T09


5:F06T10


6:F06T11


7:F06T12


8:F06T13


9:F06T14


10:F06T15


11:F06T16


 


Giving the
mtx –f /dev/sg8 status :


  Storage Changer /dev/sg8:1 Drives, 11 Slots (
0 Import/Export )


Data
Transfer Element 0:Empty


      Storage Element 1:Full 


      Storage Element 2:Full 


      Storage Element 3:Full 


      Storage Element 4:Full 


      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:Full


 


Starting a
job:


 


16-Nov
16:52 backup3-dir: Start Backup JobId 537, Job=data.2006-11-16_16.52.32


16-Nov
16:52 backup3-sd: 3301 Issuing autochanger "loaded drive 0" command.


16-Nov
16:52 backup3-sd: 3302 Autochanger "loaded drive 0", result: nothing
loaded.


16-Nov
16:52 backup3-sd: 3301 Issuing autochanger "loaded drive 0" command.


16-Nov
16:52 backup3-sd: 3302 Autochanger "loaded drive 0", result: nothing
loaded.


16-Nov
16:52 backup3-sd: Please mount Volume "F06T06" on Storage Device
"drive1" (/dev/nst0) for Job data.2006-11-16_16.52.32


 


From
bacula-sd.conf


Autochanger
{ 


  Name = "autochanger" 


  Device = "drive1" 


  Changer Device = /dev/sg8 


  Changer Command =
"/etc/bacula/mtx-changer %c %o %S %a %d" 


} 


 


Device { 


   Name = "drive1" 


   Media Type = LTO3 


   Archive Device = /dev/nst0 


   Drive Index = 0 


   Autochanger = yes 


   Automatic mount = yes 


   Autoselect = yes 


   Always Open = yes 


   Removable media = yes 


   Random access = yes 


   Spool Directory = /local/07/spool


   Maximum Spool Size = 100000000000 


   Alert Command = "sh -c 'tapeinfo -f %c
|grep TapeAlert|cat'" 


}


 


 


 


From bacula-dir.conf:


#
Definition of tape storage device 


Storage { 


  Name = backup3-sd 


  Address = xx9.xx5.xx1.25 (not the real
address)


  Maximum Concurrent Jobs = 10 


  # Must match string Director Properties in
bacula-sd.conf 


  Password = "ywZhS7MFR"     (not real)


  Device = "autochanger" 
  Media Type = LTO3 


}


 


 






I think we have a stock mtx-changer:

MTX=/usr/sbin/mtx



#touch /var/bacula/working/mtx.log
debug() {
    dbgfile="/var/bacula/working/mtx.log"
    if test -e $dbgfile; then
        echo "`date +\"%Y%m%d-%H:%M:%S\"` $*" >> $dbgfile
    fi
}


#
# Create a temporary file
#
make_temp_file() {
  TMPFILE=`mktemp -t mtx.XXXXXXXXXX`
  if test x${TMPFILE} = x; then
     TMPFILE="/var/bacula/working/mtx.$$"
     if test -f ${TMPFILE}; then
        echo "Temp file security problem on: ${TMPFILE}"
        exit 1
     fi
  fi
}

wait_for_drive() {
  i=0 
  while [ $i -le 300 ]; do  # Wait max 300 seconds
    if mt -f $1 status | grep ONLINE  >/dev/null 2>&1; then
      break
    fi
#   debug "Device $1 - not ready, retrying..."
    sleep 1
    i=`expr $i + 1`
  done
}



# check parameter count on commandline
#
check_parm_count() {
    pCount=$1
    pCountNeed=$2
    if test $pCount -lt $pCountNeed; then
        echo "usage: mtx-changer ctl-device command [slot archive-device drive-i
ndex]"
        echo "  Insufficient number of arguments arguments given."
        if test $pCount -lt 2; then
            echo "  Mimimum usage is first two arguments ..."
        else
            echo "  Command expected $pCountNeed arguments"
        fi
        exit 1
    fi
}

case $2 in
    list)
        check_parm_count $# 2
        ;;
    slots)
        check_parm_count $# 2
        ;;
    *)
        check_parm_count $# 5
        ;;
esac


# Setup arguments
ctl=$1
cmd="$2"
slot=$3
device=$4
drive=$5

case $cmd in 
   unload)
#     debug "Doing mtx -f $ctl unload $slot $drive"
#
# enable the following line if you need to eject the cartridge
#     mt -f $device offline
#     sleep 10
      ${MTX} -f $ctl unload $slot $drive
      ;;

   load)
#     debug "Doing mtx -f $ctl load $slot $drive"
      ${MTX} -f $ctl load $slot $drive
      rtn=$?
#
# Increase the sleep time if you have a slow device
# or remove the sleep and add the following:
#     wait_for_drive $device
      sleep 15
      exit $rtn
      ;;

   list) 
#     debug "Doing mtx -f $ctl -- to list volumes"
      make_temp_file
# Enable the following if you are using barcodes and need an inventory
#     $(MTX) -f $ctl inventory
#kab#      ${MTX} -f $ctl status >${TMPFILE}
      rtn=$?
#kab#      cat ${TMPFILE} | grep " *Storage Element [0-9]*:.*Full" | awk "{print
 \$3 \$4}" | sed "s/Full *\(:VolumeTag=\)*//"
      cat ${TMPFILE} | grep "^Data Transfer Element [0-9]*:Full (Storage Element
 [0-9]" | awk '{printf "%s:%s\n",$7,$10}'
#kab#      rm -f ${TMPFILE} 2>&1 >/dev/null
#
# If you have a VXA PacketLoader and the above does not work, try
#  turning it off and enabling the following line.
#     ${MTX} -f $ctl status | grep " *Storage Element [0-9]*:.*Full" | sed "s/*S
torage Element //" | sed "s/Full :VolumeTag=//"
#kab# fake barcodes
cat /etc/bacula/changer.volumes
      exit $rtn
      ;;

   loaded)
#     debug "Doing mtx -f $ctl $drive -- to find what is loaded"
      make_temp_file
      ${MTX} -f $ctl status >${TMPFILE}
      rtn=$?
      cat ${TMPFILE} | grep "^Data Transfer Element $drive:Full" | awk "{print \
$7}"
      cat ${TMPFILE} | grep "^Data Transfer Element $drive:Empty" | awk "{print 
0}"
      rm -f ${TMPFILE} 2>&1 >/dev/null
      exit $rtn
      ;;

   slots)
#     debug "Doing mtx -f $ctl -- to get count of slots"
      ${MTX} -f $ctl status | grep " *Storage Changer" | awk "{print \$5}"
      ;;
esac
 


 


Any
pointers would be appreciated.


 


Thanks


Keith G







 
____________________________________________________________________________________
Sponsored Link

$420k for $1,399/mo. 
Think You Pay Too Much For Your Mortgage? 
Find Out! www.LowerMyBills.com/lre
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to