Bacula-users

[Bacula-users] btape fails to see loaded tape

2009-08-13 13:25:06
Subject: [Bacula-users] btape fails to see loaded tape
From: "Dan Langille" <dan AT langille DOT org>
To: bacula-users AT lists.sourceforge DOT net
Date: Thu, 13 Aug 2009 13:19:30 -0400 (EDT)
I am setting up a new autochanger / tape drive.  I'm trying to run btape. 
The basic test works, but I see this message when I start btape:

 Autochanger "loaded? drive 0", result: nothing loaded.

mtx-changer [and mtx] both disagree with this:

$ sudo /etc/bacula/mtx-changer /dev/sg4 loaded 0 /dev/nst0 0
AAM240L4


I'm guessing that I'm overlooking something simple.  More eyes please?


The SD autochanger and device configuration:


Autochanger {
  Name = "LTO-4-changer"
  Device = LTO-4
  Changer Command = "/etc/bacula/mtx-changer %c %o %s %a %d"
  Changer Device = /dev/sg4
}

#
# A Linux or Solaris LTO-4 tape drive
#
Device {
  Name            = LTO-4
  Media Type      = LTO-4
  Archive Device  = /dev/nst0
  AutomaticMount  = yes;               # when device opened, read it
  AlwaysOpen      = yes;
  RemovableMedia  = yes;
  RandomAccess    = no;
  AutoChanger     = yes

#  # Enable the Alert command only if you have the mtx package loaded
## Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
## If you have smartctl, enable this, it has more info than tapeinfo
## Alert Command = "sh -c 'smartctl -H -l error %c'"
}




Debug output follows:

$ sudo /sbin/btape -d100 -c /etc/bacula/bacula-sd.conf /dev/nst0
Tape block granularity is 1024 bytes.
btape: stored_conf.c:701-0 Inserting director res:
backup01.scs.myyearbook.com-mon
btape: stored_conf.c:701-0 Inserting device res: LTO-4
btape: butil.c:285 Using device: "/dev/nst0" for writing.
btape: dev.c:269-0 init_dev: tape=1 dev_name=/dev/nst0
btape: dev.c:345-0 open dev: type=2 dev_name="LTO-4" (/dev/nst0) vol=
mode=OPEN_READ_ONLY
btape: dev.c:394-0 Open dev: device is tape
13-Aug 13:04 btape JobId 0: 3301 Issuing autochanger "loaded? drive 0"
command.
btape: autochanger.c:273-0 Run program=/etc/bacula/mtx-changer /dev/sg4
loaded 0 /dev/nst0 0
btape: autochanger.c:275-0 run_prog: /etc/bacula/mtx-changer /dev/sg4
loaded 0 /dev/nst0 0 stat=0 result=AAM240L4
13-Aug 13:04 btape JobId 0: 3302 Autochanger "loaded? drive 0", result:
nothing loaded.
btape: dev.c:409-0 Try open "LTO-4" (/dev/nst0) mode=OPEN_READ_ONLY
btape: dev.c:431-0 Rewind after open
btape: dev.c:2483-0 In set_os_device_parameters
btape: dev.c:2489-0 Set block size to zero
btape: dev.c:2505-0 MTSETDRVBUFFER
btape: dev.c:483-0 open dev: tape 3 opened
btape: dev.c:358-0 preserve=0x0 fd=3
btape: dev.c:336-0 Close fd for mode change.
btape: dev.c:345-0 open dev: type=2 dev_name="LTO-4" (/dev/nst0) vol=
mode=OPEN_READ_WRITE
btape: dev.c:394-0 Open dev: device is tape
13-Aug 13:04 btape JobId 0: 3301 Issuing autochanger "loaded? drive 0"
command.
btape: autochanger.c:273-0 Run program=/etc/bacula/mtx-changer /dev/sg4
loaded 0 /dev/nst0 0
btape: autochanger.c:275-0 run_prog: /etc/bacula/mtx-changer /dev/sg4
loaded 0 /dev/nst0 0 stat=0 result=AAM240L4
13-Aug 13:04 btape JobId 0: 3302 Autochanger "loaded? drive 0", result:
nothing loaded.
btape: dev.c:409-0 Try open "LTO-4" (/dev/nst0) mode=OPEN_READ_WRITE
btape: dev.c:431-0 Rewind after open
btape: dev.c:2483-0 In set_os_device_parameters
btape: dev.c:2489-0 Set block size to zero
btape: dev.c:2505-0 MTSETDRVBUFFER
btape: dev.c:483-0 open dev: tape 3 opened
btape: dev.c:358-0 preserve=0x0 fd=3
btape: btape.c:383 open device "LTO-4" (/dev/nst0): OK
*


-- 
Dan Langille -- http://langille.org/


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users