Hello everyone!

I have a problem with the behaviour of my bacula-dir, resulting in failures as you can see below.
Please, does somebody know what the reason is and how to correct it?
My system:
- bacula 1.38.9 (from source)
- mtx 1.2.18rel (from rpm)
- SuSE 9.0 Kernel 2.4.21-99
- Exabyte 221L TapeLibrary (21 slots in 3 Magazines, Barcodereader, 1 IBM Ultrium LTO-2 drive)


I add mtx-changer and bacula-sd.conf at the end of this mail.

Output from bacula/working/log:

07-Jul 23:00 heem-dir: Start Backup JobId 259, Job=No.2_2006-07-07_23.00.00
07-Jul 23:00 heem-sd: 3301 Issuing autochanger "loaded drive 0" command.
07-Jul 23:00 heem-sd: 3991 Bad autochanger "loaded drive 0" command: ERR=Operation not permitted.
07-Jul 23:00 heem-sd: 3301 Issuing autochanger "loaded drive 0" command.
07-Jul 23:00 heem-sd: 3991 Bad autochanger "loaded drive 0" command: ERR=Operation not permitted.
07-Jul 23:00 heem-sd: 3304 Issuing autochanger "load slot 15, drive 0" command.
07-Jul 23:00 heem-sd: No.2_2006-07-07_23.00.00 Fatal error: 3992 Bad autochanger "load slot 15, drive 0": ERR=Child exited with c
ode 1.
07-Jul 22:59 dali-fd: No.2_2006-07-07_23.00.00 Fatal error: job.c:1617 Bad response to Append Data command. Wanted 3000 OK data
, got 3903 Error append data

07-Jul 23:00 heem-dir: No.2_2006-07-07_23.00.00 Error: Bacula 1.38.9 (02May06): 07-Jul-2006 23:00:05
  JobId:                  259
  Job:                     No.2_2006-07-07_23.00.00
  Backup Level:           Full
  Client:                 "dali-fd" i686-pc-linux-gnu,suse,9.0
  FileSet:                "FileSet2" 2006-06-15 00:45:31
  Pool:                   "Monthly_Archive"
  Storage:                "TapeLibrary"
  Scheduled time:         07-Jul-2006 23:00:00
  Start time:             07-Jul-2006 23:00:04
  End time:               07-Jul-2006 23:00:05
  Elapsed time:           1 sec
  Priority:               10
  FD Files Written:       0
  SD Files Written:       0
  FD Bytes Written:       0 (0 B)
  SD Bytes Written:       0 (0 B)
  Rate:                   0.0 KB/s
  Software Compression:   None
  Volume name(s):
  Volume Session Id:      3
  Volume Session Time:    1152282951
  Last Volume Bytes:      124,972,759,051 (124.9 GB)
  Non-fatal FD errors:    0
  SD Errors:              0
  FD termination status:  Error
  SD termination status:  Error
  Termination:            *** Backup Error ***


2nd failed job:

08-Jul 07:17 heem-dir: Start Backup JobId 263, Job= No.4_.2006-07-08_01.00.00
08-Jul 07:17 heem-sd: 3301 Issuing autochanger "loaded drive 0" command.
08-Jul 07:17 heem-sd: 3991 Bad autochanger "loaded drive 0" command: ERR=Operation not permitted.
08-Jul 07:17 heem-sd: 3301 Issuing autochanger "loaded drive 0" command.
08-Jul 07:17 heem-sd: 3991 Bad autochanger "loaded drive 0" command: ERR=Operation not permitted.
08-Jul 07:17 heem-sd: 3304 Issuing autochanger "load slot 16, drive 0" command.
08-Jul 07:17 heem-sd: No.4_.2006-07-08_01.00.00 Fatal error: 3992 Bad autochanger "load slot 16, drive 0": ERR=Child exited with c
ode 1.
08-Jul 07:17 raid2-fd: No.4_.2006-07-08_01.00.00 Fatal error: job.c:1617 Bad response to Append Data command. Wanted 3000 OK data
, got 3903 Error append data

08-Jul 07:17 heem-dir: No.4_.2006-07-08_01.00.00 Error: Bacula 1.38.9 (02May06): 08-Jul-2006 07:17:12
  JobId:                  263
  Job:                    No.4_.2006-07-08_01.00.00
  Backup Level:           Full
  Client:                 "raid2-fd" i686-pc-linux-gnu,suse,9.0
  FileSet:                "FileSet4" 2006-06-17 09:09:48
  Pool:                   "Monthly_Archive"
  Storage:                "TapeLibrary"
  Scheduled time:         08-Jul-2006 01:00:00
  Start time:             08-Jul-2006 07:17:10
  End time:               08-Jul-2006 07:17:12
  Elapsed time:           2 secs
  Priority:               10
  FD Files Written:       0
  SD Files Written:       0
  FD Bytes Written:       0 (0 B)
  SD Bytes Written:       0 (0 B)
  Rate:                   0.0 KB/s
  Software Compression:   None
  Volume name(s):
  Volume Session Id:      7
  Volume Session Time:    1152282951
  Last Volume Bytes:      42,298,701,358 (42.29 GB)
  Non-fatal FD errors:    0
  SD Errors:              0
  FD termination status:  Error
  SD termination status:  Error
  Termination:            *** Backup Error ***











Thanks for looking at it!

Best Regards,

i. A. Christoff Buch

=====================================
[EMAIL PROTECTED]
+49.941.78004.607

[EMAIL PROTECTED]
OneVision Software AG
Dr.-Leo-Ritter-Str. 9
D - 93049 Regensburg

Attachment: bacula-sd.conf
Description: Binary data

#!/bin/sh
#
# Bacula interface to mtx autoloader    Adapted by Christoff Buch, OneVision 
Software AG, 2006-05-31
#
#  $Id: mtx-changer.in,v 1.21.2.7 2006/05/02 14:48:12 kerns Exp $
#
#  If you set in your Device resource
#
#  Changer Command = "path-to-this-script/mtx-changer %c %o %S %a %d"
#    you will have the following input to this script:
#
#  So Bacula will always call with all the following arguments, even though
#    in come cases, not all are used.
#
#  mtx-changer "changer-device" "command" "slot" "archive-device" "drive-index"
#                  $1              $2       $3        $4               $5
#
#  for example:
#
#  mtx-changer /dev/sg0 load 1 /dev/nst0 0 (on a Linux system)
# 
#  will request to load the first cartidge into drive 0, where
#   the SCSI control channel is /dev/sg0, and the read/write device
#   is /dev/nst0.
#
#  If you need to an offline, refer to the drive as $4
#    e.g.   mt -f $4 offline
#
#  Many changers need an offline after (Sorry, not before?) the unload. Also 
many
#   changers need a sleep 60 after the mtx load.
#
#  N.B. If you change the script, take care to return either 
#   the mtx exit code or a 0. If the script exits with a non-zero
#   exit code, Bacula will assume the request failed.
#

MTX=mtx

#
# log whats done
#
# to turn on logging, uncomment the following line
#touch /usr/local/bacula/working/mtx.log
#
dbgfile="/usr/local/bacula/working/mtx.log"
debug() {
    if test -f $dbgfile; then
        echo "`date +\"%Y%m%d-%H:%M:%S\"` $*" >> $dbgfile
    fi
}


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

#
# The purpose of this function to wait a maximum 
#   time for the drive. It will
#   return as soon as the drive is ready, or after
#   waiting a maximum of 300 seconds.
# Note, this is very system dependent, so if you are
#   not running on Linux, you will probably need to
#   re-write it, or at least change the grep target.
#
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-index]"
        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
}

# Check for special cases where only 2 arguments are needed, 
#  all others are a minimum of 5
#
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

debug "Parms: $ctl $cmd $slot $device $drive"

case $cmd in 
   unload)
      debug "Doing mtx -f $ctl unload $slot $drive"
#
# enable the following line if you need to eject the cartridge
# the following two(!)lines enabled by Christoff Buch, OneVision Software AG, 
2006-05-31
      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:
# the following line enabled by Christoff Buch, OneVision Software AG, 
2006-05-31
     wait_for_drive $device

# the following line disabled by Christoff Buch, OneVision Software AG, 
2006-05-31
#      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
# OneVision Software AG, Exabyte 221L tape library doesn't need this!
# Exabyte 221L scans barcodes after POST. Left as is by Christoff Buch, 
OneVision Software AG, 2006-05-31
#     $(MTX) -f $ctl inventory
      ${MTX} -f $ctl status >${TMPFILE}
      rtn=$?
      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}'
      rm -f ${TMPFILE} >/dev/null 2>&1
#
# 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/*Storage Element //" | sed "s/Full :VolumeTag=//"
      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} >/dev/null 2>&1
      exit $rtn
      ;;

   slots)
      debug "Doing mtx -f $ctl -- to get count of slots"
      ${MTX} -f $ctl status | grep " *Storage Changer" | awk "{print \$5}"
      ;;
esac
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to