Hi all

First off, I have bacula (v1.38) up and running at work with a Overland LTO3 unit (zero problems!), so I thought it might be worth getting it set up at home as well (hell, my MP3s are far more important than work data :)

... and I run into a problem at the first hurdle. I am trying to run "btape" to check the autochanger, and its failing (yes, even with the "mt $device offline" line enabled in mtx-changer)

System: Fedora Core 4, Kernel  2.6.14-1.1653_FC4
Bacula: v1.38.5, compiled from source
Tape Drive: ADIC DLT7000, 7 tape library

Library device: /dev/sg0
Tape Device: /dev/nst0

mtx and mt work from command line just fine, writing directly to /dev/nst0 with tar writes and reads the data correctly, and for my tests I am running as root.

The attached text file is the output of the following btape command:

btape -d 100 -v -c /etc/bacula/bacula-sd.conf /dev/nst0

Does anyone here have any idea why the btape autochanger commands are failing? I have been sitting here looking at it for an hour or two now, and its got me beat.

Any help would be greatly appreciated.

Steve
[EMAIL PROTECTED] ~]# btape -d 100 -v -c /etc/bacula/bacula-sd.conf /dev/nst0
Tape block granularity is 1024 bytes.
btape: stored_conf.c:613 Inserting director res: mother-mon
btape: stored_conf.c:613 Inserting device res: ADIC-DLT7000
btape: butil.c:269 Using device: "/dev/nst0" for writing.
btape: dev.c:242 init_dev: tape=2 dev_name=/dev/nst0
btape: dev.c:277 open dev: tape=2 dev_name="ADIC-DLT7000" (/dev/nst0) vol= 
mode=OPEN_READ_ONLY
btape: dev.c:323 open dev: device is tape
btape: autochanger.c:249 Locking changer ADIC-Library
23-Jan 20:54 btape: 3301 Issuing autochanger "loaded drive 0" command.
btape: autochanger.c:220 run_prog: /etc/bacula/mtx-changer /dev/sg0 loaded 0 
/dev/nst0 0 stat=0 result=1

23-Jan 20:54 btape: 3302 Autochanger "loaded drive 0", result is Slot 1.
btape: autochanger.c:258 Unlocking changer ADIC-Library
btape: dev.c:338 Try open "ADIC-DLT7000" (/dev/nst0) mode=OPEN_READ_ONLY 
nonblocking=2048
btape: dev.c:369 openmode=3 OPEN_READ_ONLY
btape: dev.c:382 open dev: tape 3 opened
btape: dev.c:269 Close fd for mode change.
btape: dev.c:277 open dev: tape=2 dev_name="ADIC-DLT7000" (/dev/nst0) vol= 
mode=OPEN_READ_WRITE
btape: dev.c:323 open dev: device is tape
btape: autochanger.c:249 Locking changer ADIC-Library
23-Jan 20:54 btape: 3301 Issuing autochanger "loaded drive 0" command.
btape: autochanger.c:220 run_prog: /etc/bacula/mtx-changer /dev/sg0 loaded 0 
/dev/nst0 0 stat=0 result=1

23-Jan 20:54 btape: 3302 Autochanger "loaded drive 0", result is Slot 1.
btape: autochanger.c:258 Unlocking changer ADIC-Library
btape: dev.c:338 Try open "ADIC-DLT7000" (/dev/nst0) mode=OPEN_READ_WRITE 
nonblocking=2048
btape: dev.c:369 openmode=2 OPEN_READ_WRITE
btape: dev.c:382 open dev: tape 3 opened
btape: btape.c:338 open device "ADIC-DLT7000" (/dev/nst0): OK
*auto
btape: btape.c:1101 Max changer wait = 300 sec

Ah, I see you have an autochanger configured.
To test the autochanger you must have a blank tape
 that I can write on in Slot 1.

Do you wish to continue with the Autochanger test? (y/n): y


=== Autochanger test ===

3301 Issuing autochanger "loaded" command.
btape: btape.c:1133 run_prog: /etc/bacula/mtx-changer /dev/sg0 loaded 1 
/dev/nst0 0 stat=0 result="1
"
Slot 1 loaded. I am going to unload it.
btape: btape.c:1147 Results from loaded query=1

btape: dev.c:621 rewind res=0 fd=3 "ADIC-DLT7000" (/dev/nst0)
btape: device.c:322 Force close_dev "ADIC-DLT7000" (/dev/nst0)
btape: dev.c:1685 really close_dev "ADIC-DLT7000" (/dev/nst0)
btape: dvd.c:93 Enter unmount_dev
3302 Issuing autochanger "unload 1 0" command.
unload status=OK 0
3303 Issuing autochanger "load 1 0" command.
btape: btape.c:1176 Changer=/etc/bacula/mtx-changer /dev/sg0 load 1 /dev/nst0 0
3303 Autochanger "load 1 0" status is OK.
btape: dev.c:277 open dev: tape=2 dev_name="ADIC-DLT7000" (/dev/nst0) vol= 
mode=OPEN_READ_WRITE
btape: dev.c:323 open dev: device is tape
btape: autochanger.c:249 Locking changer ADIC-Library
23-Jan 20:56 btape: 3301 Issuing autochanger "loaded drive 0" command.
btape: autochanger.c:220 run_prog: /etc/bacula/mtx-changer /dev/sg0 loaded 1 
/dev/nst0 0 stat=0 result=1

23-Jan 20:56 btape: 3302 Autochanger "loaded drive 0", result is Slot 1.
btape: autochanger.c:258 Unlocking changer ADIC-Library
btape: dev.c:338 Try open "ADIC-DLT7000" (/dev/nst0) mode=OPEN_READ_WRITE 
nonblocking=2048
btape: dev.c:369 openmode=2 OPEN_READ_WRITE
btape: dev.c:382 open dev: tape 3 opened
btape: btape.c:338 open device "ADIC-DLT7000" (/dev/nst0): OK
btape: dev.c:621 rewind res=0 fd=3 "ADIC-DLT7000" (/dev/nst0)
btape: dev.c:277 open dev: tape=2 dev_name="ADIC-DLT7000" (/dev/nst0) vol= 
mode=OPEN_READ_WRITE
btape: dev.c:323 open dev: device is tape
btape: autochanger.c:249 Locking changer ADIC-Library
23-Jan 20:56 btape: 3301 Issuing autochanger "loaded drive 0" command.
btape: autochanger.c:220 run_prog: /etc/bacula/mtx-changer /dev/sg0 loaded 1 
/dev/nst0 0 stat=0 result=1

23-Jan 20:56 btape: 3302 Autochanger "loaded drive 0", result is Slot 1.
btape: autochanger.c:258 Unlocking changer ADIC-Library
btape: dev.c:338 Try open "ADIC-DLT7000" (/dev/nst0) mode=OPEN_READ_WRITE 
nonblocking=2048
btape: dev.c:369 openmode=2 OPEN_READ_WRITE
btape: dev.c:382 open dev: tape 3 opened
btape: btape.c:1198 Bad status from rewind. ERR=dev.c:672 Rewind error on 
"ADIC-DLT7000" (/dev/nst0). ERR=Input/output error.


The test failed, probably because you need to put
a longer sleep time in the mtx-script in the load) case.
Adding a 30 second sleep and trying again ...
3301 Issuing autochanger "loaded" command.
btape: btape.c:1133 run_prog: /etc/bacula/mtx-changer /dev/sg0 loaded 1 
/dev/nst0 0 stat=0 result="1
"
Slot 1 loaded. I am going to unload it.
btape: btape.c:1147 Results from loaded query=1

Reply via email to