I've always had a problem with mtx-changer regarding this issue. Even when I'm running the SD as root, my tape drives always show "Device busy" when I do an 'mt -f /dev/rmt/0cbn status'. The drives are always busy while bacula-sd is running, with or without tapes in the drives and not performing any backups.
Therefore, I'm always stuck waiting 180 seconds for the timeout when I want to load a tape. The tapes load just fine, but the drive won't ever settle down and show "ONLINE" ("0x0" in my case) while the SD is running. I've changed the timeout to 60 seconds to ease the pain. This problem affects other parts of Bacula that request the drive status. When I first start the SD, I have to wait for the timeout period for both drives before I can do anything. Does Bacula put some kind of lock or hog resources of the tape drives that prevents showing the tape status correctly? When I was running Legato Networker, I was always able to do mt -f /dev/rmt/0cbn status while Legato was running and the drive was idle. My setup is: Solaris 9 L25 Autochanger with two SDLT 320 drives Bacula 1.38.5 Thanks, Ray -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arno Lehmann Sent: Friday, March 10, 2006 5:13 AM To: bacula-users@lists.sourceforge.net Subject: Re: [Bacula-users] tape will not eject after finishing backup Hello, On 3/10/2006 11:00 AM, david robert wrote: > these are the two places i can see this function can we increse these > time or You'd use this snippet in your script. > wait_for_drive() { > for i in $(seq 180); do # Wait max 180 seconds > if mt -f $1 status | grep ONLINE >/dev/null 2>&1; then # and, before you implement this, make sure your tape drive status # is actually ONLINE after unmount from Bacula. > break > fi > # echo "Device $1 - not ready, retrying..." > sleep 1 > done > } Also, one thing I overlooked in my previous post: With a DLT drive, you can't usually eject the cartridge after rewinding, you have to offline the drive, too. The combined command 'mt rewoffline' might thus already solve your problem. Arno > ------------ > > # wait_for_drive $device > sleep 15 > exit $rtn > ;; > > thanks for your help > > */Arno Lehmann <[EMAIL PROTECTED]>/* wrote: > > Hello, > > On 3/10/2006 10:29 AM, Gavin Conway wrote: > > Hi, > > > > I'm seeing the same problem using a very similar script. Also using > > Debian Sarge 3.1 with the latest version of Bacula. I think this > is more > > to do with Bacula not having finished with the tape drive when the > > script runs. > > > > If anyone knows how this goes let me know. > > If you are right with your suspicion, you could wait for the tape to > become available before executing the commands. In the mtx-changer > script, there's a function wait_for_drive which you could use as a > template. Basically, it checks if the drive is ready, and if it > isn't it > waits some time and loops. > > Arno > > > Thanks, > > Gavin > > > > -- > IT-Service Lehmann [EMAIL PROTECTED] > Arno Lehmann http://www.its-lehmann.de > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web an d mobile media. Attend the > live webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Bacula-users mailing list > Bacula-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bacula-users > > > *Yahoo! Photos* > <http://us.rd.yahoo.com/mail/uk/taglines/default/photos/*http://uk.photo s.yahoo.com/> > - NEW , now offering a quality print service > <http://us.rd.yahoo.com/mail/uk/taglines/default/photos/*http://uk.photo s.yahoo.com/> > from just 8p a photo. -- IT-Service Lehmann [EMAIL PROTECTED] Arno Lehmann http://www.its-lehmann.de ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users