Bacula-users

Re: [Bacula-users] mtx-changer load timeout

2011-07-15 18:38:45
Subject: Re: [Bacula-users] mtx-changer load timeout
From: Ron King <rking AT mro.nmt DOT edu>
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 15 Jul 2011 16:05:26 -0600
-----> Hi All,
----->
-----> I'm wondering if anyone else has run across this. I'm running bacula5.0.2 on Linux (Centos 5) and I'm getting a timeout whenever I use the mtx-changer script to load a tape.
----->
-----> I looked at the script and it determines timeout from this:
----->
-----> wait_for_drive() {
----->   i=0
----->   while [ $i -le 300 ]; do  # Wait max 300 seconds
----->     if mt -f $1 status 2>&1 | grep "${ready}" >/dev/null 2>&1; then
----->       break
----->     fi
----->     debug "Device $1 - not ready, retrying..."
----->     sleep 1
----->     i=`expr $i + 1`
----->   done
-----> }
----->
-----> but when I issue:
----->
-----> mt -f /dev/nst0 status
----->
-----> I get this:
----->
-----> SCSI 2 tape drive:
-----> File number=-1, block number=-1, partition=0.
-----> Tape block size 0 bytes. Density code 0x0 (default).
-----> Soft error count since last status=0
-----> General status bits on (50000):
----->  DR_OPEN IM_REP_EN
----->
-----> No where does it say 'ready' .
----->
-----> I might be able to kludge something, but I wonder if anyone has a solution to this. I'd be surprised if it hadn't come up before, unless I'm missing something obvious, which is certainly very possible.
----->
-----> thanks,
----->
-----> Eli
----->
-----> +----------------------------------------------------------------------
-----> |This was sent by ermorris@... via Backup Central.
-----> |Forward SPAM to abuse@....
-----> +----------------------------------------------------------------------

Hello Eli,
I just joined the list and was reading past posts.  If this is old news, I apologize.
I had a similar issue.  The '${ready}' is actually a variable found in the mtx-changer.conf file.  The following code
    if test -f /etc/debian_version ; then
       mt --version|grep "mt-st" >/dev/null 2>&1
       if test $? -eq 1 ; then
          ready="drive status"
       fi
    fi
was a workaround at one point.  Commenting out those lines fixed my problem as it appears that debian fixed the issue with mt at some point.

The "DR_OPEN IM_REP_EN" line should appear as "BOT ONLINE IM_REP_EN" if the drive is loaded with a tape.  From your output, I'd say you either didn't have a tape loaded, or you selected the wrong device to look at.  I had a similar issue as the order of the devices in the changer were reversed under /dev - meaning what I'd assume to be /dev/nst0 was actually /dev/nst1 and vice versa.  A simple check would be to load a tape and issue the 'mt -f /dev/nst0 status' command against all the /dev/nst* devices.  If this is your case, you can switch the devices around in the bacula-sd.conf file and

regards,
Ron
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Bacula-users] mtx-changer load timeout, Ron King <=