Brian Debelius wrote: > Try turning on debug in mtx-changer. Modify the wait_for_drive() > function to add another debug statement to confirm that the device is > ready, and that the function did not just time out. > > 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 > -->> debug "Device $1 - READY!" > break > fi > debug "Device $1 - not ready, retrying..." > sleep 1 > i=`expr $i + 1` > done > }
Thanks Brian, I added this and it seems to indicate things are working OK without adding any sleep, so I need to keep looking. The following is the sequence as I attempt to label a tape after having deleted the Volume record, manually rewound the tape and done an "mt -f /dev/nst0 weof" and placed it back in Slot 1. Start bacula. Do a "status" on the SD: Device status: Autochanger "HP_MSL2024" with devices: "Drive-1" (/dev/nst0) Device "Drive-1" (/dev/nst0) is not open. Drive 0 status unknown. Do an "automount off" Do a "label": Connecting to Storage daemon HP_MSL2024 at library1.sauce.co.nz:9103 ... Sending label command for Volume "GQJ800L4" Slot 1 ... 3301 Issuing autochanger "loaded? drive 0" command. 3302 Autochanger "loaded? drive 0", result: nothing loaded. 3304 Issuing autochanger "load slot 1, drive 0" command. 3305 Autochanger "load slot 1, drive 0", status is OK. block.c:1010 Read error on fd=5 at file:blk 0:0 on device "Drive-1" (/dev/nst0). ERR=Device or resource busy. 3000 OK label. VolBytes=1024 DVD=0 Volume="GQJ800L4" Device="Drive-1" (/dev/nst0) Catalog record for Volume "GQJ800L4", Slot 1 successfully created. Do not forget to mount the drive!!! Tailing the mtx.log showed the "Device /dev/nst0 - READY!" up at the same time as "3305" above then there was a pause of a few seconds, presumably as the tape threads up and then the "Read error...." At this point another "status" on the SD: Device status: Autochanger "HP_MSL2024" with devices: "Drive-1" (/dev/nst0) Device "Drive-1" (/dev/nst0) is not open. Slot 1 is loaded in drive 0. I run "mt -f /dev/nst0 status" at this point with bacula still running: SCSI 2 tape drive: File number=1, block number=0, partition=0. Tape block size 0 bytes. Density code 0x46 (LTO-4). Soft error count since last status=0 General status bits on (81010000): EOF ONLINE IM_REP_EN Do a "mount" and after about 20 seconds: block.c:1010 Read error on fd=5 at file:blk 0:0 on device "Drive-1" (/dev/nst0). ERR=Device or resource busy. 3902 Cannot mount Volume on Storage Device "Drive-1" (/dev/nst0) because: Requested Volume "" on "Drive-1" (/dev/nst0) is not a Bacula labeled Volume, because: ERR=block.c:1010 Read error on fd=5 at file:blk 0:0 on device "Drive-1" (/dev/nst0). ERR=Device or resource busy. 3905 Device "Drive-1" (/dev/nst0) open but no Bacula volume is mounted. If this is not a blank tape, try unmounting and remounting the Volume. Do a "status" on SD: Device status: Autochanger "HP_MSL2024" with devices: "Drive-1" (/dev/nst0) Device "Drive-1" (/dev/nst0) open but no Bacula volume is currently mounted. Slot 1 is loaded in drive 0. Total Bytes Read=0 Blocks Read=0 Bytes/block=0 Positioned at File=0 Block=0 Do an "mt -f /dev/nst0 status": /dev/nst0: Device or resource busy Which is fair, as bacula now has the device open. So I really do not know what the drive's problem is during the "label" - why is it busy? Regards, Richard ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users