Welcome! » Log In » Create A New Profile

Configuring a fake autochanger for a standalone tape drive in 9.0.2

Posted by Phil Stracchino 
I've just upgraded from Bacula 7.4.7, in which my standalone LTO4 tape
drive worked perfectly, to Bacula 9.0.2, in which it doesn't. In 9.0.2,
I had to use the workaround of setting up a fake autochanger with one drive.

The problem is that this trick is not documented, and I had to largely
figure it out by trial and error and reference to outdated documentation
that doesn't address the fake-autochanger case anyway. The mtx-changer
command is just copied directly from a standard changer invocation, and
Changer Device is a total guess - it's the generic SCSI device
corresponding to the tape drive. I don't know if it's right, wrong, or
unneeded, or what to use in its place. I also don't know whether any of
the directives in the Device description are obsolete or not needed any
more.



Here's the configuration in my Director:

Storage {
Name = babylon5-sd
Address = babylon5.babcom.com
SDPort = 9103
Password = "********************"
Device = babylon5-changer
Media Type = LTO-4
Maximum Concurrent Jobs = 20
Autochanger = yes
}


And on the relevant Storage:

Autochanger {
Name = babylon5-changer
Device = LTO-4
Changer Command = "/usr/libexec/bacula/mtx-changer %c %o %S %a %d"
Changer Device = /dev/sg5 # this is largely a guess
}

Device {
Name = LTO-4
Media Type = LTO-4
Archive Device = /dev/nst0
Drive Index = 0 # pretend
Autochanger = yes # pretend
AutomaticMount = yes # when device opened, read it
AlwaysOpen = yes
OfflineOnUnmount = yes
RemovableMedia = yes
RandomAccess = no
Maximum File Size = 5GB
Maximum Block Size = 2048000
Spool Directory = /var/tmp/bacula
Maximum Spool Size = 10GB
Maximum Job Spool Size = 5GB
}


Now, this *WORKS.* But it throws non-fatal mtx-changer errors like this:


01-Aug 14:11 minbar-dir JobId 14328: BeforeJob: Client babylon5 has address
+10.24.32.10
01-Aug 14:11 minbar-dir JobId 14328: Start Backup JobId 14328,
+Job=Babylon5_Backup.2017-08-01_14.11.23_04
01-Aug 14:11 minbar-dir JobId 14328: Using Device "LTO-4" to write.
01-Aug 14:11 babylon5-sd JobId 14328: No slot defined in catalog
(slot=0) for Volume
+"LTO4-FULL-0024" on "LTO-4" (/dev/nst0).
01-Aug 14:11 babylon5-sd JobId 14328: Cartridge change or "update slots"
may be
+required.
01-Aug 14:11 babylon5-sd JobId 14328: 3991 Bad autochanger "loaded? drive 0"
+command: ERR=Child exited with code 1.
Results=mtx: Request Sense: Long Report=yes
mtx: Request Sense: Valid Residual=no
mtx: Request Sense: Error Code=70 (Current)
mtx: Request Sense: Sense Key=Illegal Request
mtx: Request Sense: FileMark=no
mtx: Request Sense: EOM=no
mtx: Request Sense: ILI=no
mtx: Request Sense: Additional Sense Code = 20
mtx: Request Sense: Additional Sense Qualifier = 00
mtx: Request Sense: BPV=no
mtx: Request Sense: Error in CDB=no
mtx: Request Sense: SKSV=no
READ ELEMENT STATUS Command Failed

01-Aug 14:11 babylon5-sd JobId 14328: Recycled volume "LTO4-FULL-0007"
on Tape
+device "LTO-4" (/dev/nst0), all previous data lost.


I get similar errors from mounting and unmounting volumes. Clearly
mtx-changer is really not on board with this whole "fake autochanger'
thing. Does anyone know what changes I should make to eliminate these
errors? Is there a specific way to configure mtx-changer for the "fake
autochanger" case? Should I be even using a Changer Command at all if
there is no Changer?



--
Phil Stracchino
Babylon Communications
phils@caerllewys.net
phil@co.ordinate.org
Landline: +1.603.293.8485
Mobile: +1.603.998.6958

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users
This message was imported via the External PhorumMail Module
Re: Configuring a fake autochanger for a standalone tape drive in 9.0.2
August 01, 2017 01:01PM
Hello Phil,

There should be no difference in how Bacula handles tapes between 7.4.7
and 9.0.x. If there is I would suggest that you carefully document it
in a way that I can "see" the problem and easily reproduce it so that I
can fix it. mtx-changer will *not* work unless you have an
autochanger. There is no fake autochanger for tapes. There are two
types of "fake" autochangers for Disks. The first one is something like
mhvtl that is a program that simulates in detail and autochanger. The
second is the Bacula virtual disk autochanger.

If you have a real stand-alone tape drive, I personally know of no way
to make it work with mtx, and if Bacula does not work with it, I will be
happy to work on fixing it, but only if it is clearly documented in a
detailed but very concise way.

The Bacula virtual disk autochanger and certain other cases are very
nicely documented in several of the white papers that are on www.bacula.org.

Best regards,

Kern


On 08/01/2017 08:44 PM, Phil Stracchino wrote:
> I've just upgraded from Bacula 7.4.7, in which my standalone LTO4 tape
> drive worked perfectly, to Bacula 9.0.2, in which it doesn't. In 9.0.2,
> I had to use the workaround of setting up a fake autochanger with one drive.
>
> The problem is that this trick is not documented, and I had to largely
> figure it out by trial and error and reference to outdated documentation
> that doesn't address the fake-autochanger case anyway. The mtx-changer
> command is just copied directly from a standard changer invocation, and
> Changer Device is a total guess - it's the generic SCSI device
> corresponding to the tape drive. I don't know if it's right, wrong, or
> unneeded, or what to use in its place. I also don't know whether any of
> the directives in the Device description are obsolete or not needed any
> more.
>
>
>
> Here's the configuration in my Director:
>
> Storage {
> Name = babylon5-sd
> Address = babylon5.babcom.com
> SDPort = 9103
> Password = "********************"
> Device = babylon5-changer
> Media Type = LTO-4
> Maximum Concurrent Jobs = 20
> Autochanger = yes
> }
>
>
> And on the relevant Storage:
>
> Autochanger {
> Name = babylon5-changer
> Device = LTO-4
> Changer Command = "/usr/libexec/bacula/mtx-changer %c %o %S %a %d"
> Changer Device = /dev/sg5 # this is largely a guess
> }
>
> Device {
> Name = LTO-4
> Media Type = LTO-4
> Archive Device = /dev/nst0
> Drive Index = 0 # pretend
> Autochanger = yes # pretend
> AutomaticMount = yes # when device opened, read it
> AlwaysOpen = yes
> OfflineOnUnmount = yes
> RemovableMedia = yes
> RandomAccess = no
> Maximum File Size = 5GB
> Maximum Block Size = 2048000
> Spool Directory = /var/tmp/bacula
> Maximum Spool Size = 10GB
> Maximum Job Spool Size = 5GB
> }
>
>
> Now, this *WORKS.* But it throws non-fatal mtx-changer errors like this:
>
>
> 01-Aug 14:11 minbar-dir JobId 14328: BeforeJob: Client babylon5 has address
> +10.24.32.10
> 01-Aug 14:11 minbar-dir JobId 14328: Start Backup JobId 14328,
> +Job=Babylon5_Backup.2017-08-01_14.11.23_04
> 01-Aug 14:11 minbar-dir JobId 14328: Using Device "LTO-4" to write.
> 01-Aug 14:11 babylon5-sd JobId 14328: No slot defined in catalog
> (slot=0) for Volume
> +"LTO4-FULL-0024" on "LTO-4" (/dev/nst0).
> 01-Aug 14:11 babylon5-sd JobId 14328: Cartridge change or "update slots"
> may be
> +required.
> 01-Aug 14:11 babylon5-sd JobId 14328: 3991 Bad autochanger "loaded? drive 0"
> +command: ERR=Child exited with code 1.
> Results=mtx: Request Sense: Long Report=yes
> mtx: Request Sense: Valid Residual=no
> mtx: Request Sense: Error Code=70 (Current)
> mtx: Request Sense: Sense Key=Illegal Request
> mtx: Request Sense: FileMark=no
> mtx: Request Sense: EOM=no
> mtx: Request Sense: ILI=no
> mtx: Request Sense: Additional Sense Code = 20
> mtx: Request Sense: Additional Sense Qualifier = 00
> mtx: Request Sense: BPV=no
> mtx: Request Sense: Error in CDB=no
> mtx: Request Sense: SKSV=no
> READ ELEMENT STATUS Command Failed
>
> 01-Aug 14:11 babylon5-sd JobId 14328: Recycled volume "LTO4-FULL-0007"
> on Tape
> +device "LTO-4" (/dev/nst0), all previous data lost.
>
>
> I get similar errors from mounting and unmounting volumes. Clearly
> mtx-changer is really not on board with this whole "fake autochanger'
> thing. Does anyone know what changes I should make to eliminate these
> errors? Is there a specific way to configure mtx-changer for the "fake
> autochanger" case? Should I be even using a Changer Command at all if
> there is no Changer?
>
>
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users
This message was imported via the External PhorumMail Module
On 08/01/17 15:14, Kern Sibbald wrote:
> Hello Phil,
>
> There should be no difference in how Bacula handles tapes between 7.4.7
> and 9.0.x. If there is I would suggest that you carefully document it
> in a way that I can "see" the problem and easily reproduce it so that I
> can fix it. mtx-changer will *not* work unless you have an
> autochanger. There is no fake autochanger for tapes. There are two
> types of "fake" autochangers for Disks. The first one is something like
> mhvtl that is a program that simulates in detail and autochanger. The
> second is the Bacula virtual disk autochanger.


I did already report this finding in detail in my test reports in
bacula-devel. If it SHOULD work, I will revert my configuration and
re-test.

What I found was that a tape could be read and written in a standalone
drive if already mounted when the SD was started, but could not be
mounted or unmounted except by stopping the SD and manually using mt.
Running the SD at -d 200, it appeared the SD never received the
mount/unmount commands.

The 'fake autochanger' workaround was suggested by Ana Arruda, who said:

"I don't remember in what version the old tape drive configuration in
bacula-dir.conf as a stand alone storage device was causing the
mount/unmount bconsole commands to do nothing and this is the workaround
we have to make it work."


--
Phil Stracchino
Babylon Communications
phils@caerllewys.net
phil@co.ordinate.org
Landline: +1.603.293.8485
Mobile: +1.603.998.6958

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users
This message was imported via the External PhorumMail Module
On 08/01/17 15:14, Kern Sibbald wrote:
> Hello Phil,
>
> There should be no difference in how Bacula handles tapes between 7.4.7
> and 9.0.x. If there is I would suggest that you carefully document it
> in a way that I can "see" the problem and easily reproduce it so that I
> can fix it. mtx-changer will *not* work unless you have an
> autochanger. There is no fake autochanger for tapes. There are two
> types of "fake" autochangers for Disks. The first one is something like
> mhvtl that is a program that simulates in detail and autochanger. The
> second is the Bacula virtual disk autochanger.


I did already report this finding in detail in my test reports in
bacula-devel. If it SHOULD work, I will revert my configuration and
re-test.

What I found was that a tape could be read and written in a standalone
drive if already mounted when the SD was started, but could not be
mounted or unmounted except by stopping the SD and manually using mt.
Running the SD at -d 200, it appeared the SD never received the
mount/unmount commands.

The 'fake autochanger' workaround was suggested by Ana Arruda, who said:

"I don't remember in what version the old tape drive configuration in
bacula-dir.conf as a stand alone storage device was causing the
mount/unmount bconsole commands to do nothing and this is the workaround
we have to make it work."


--
Phil Stracchino
Babylon Communications
phils@caerllewys.net
phil@co.ordinate.org
Landline: +1.603.293.8485
Mobile: +1.603.998.6958

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users
This message was imported via the External PhorumMail Module
....Actually, even the fake-autochanger works only to load tapes, not to
unload.


--
Phil Stracchino
Babylon Communications
phils@caerllewys.net
phil@co.ordinate.org
Landline: +1.603.293.8485
Mobile: +1.603.998.6958

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users
This message was imported via the External PhorumMail Module
On 08/01/17 16:09, Phil Stracchino wrote:
>
> ...Actually, even the fake-autochanger works only to load tapes, not to
> unload.

I have just reverted my configuration. Director, in bacula-dir.conf:


Storage {
Name = babylon5-sd
Address = babylon5.babcom.com
SDPort = 9103
Password = "********************"
Device = LTO-4
Media Type = LTO-4
Maximum Concurrent Jobs = 20
Autochanger = no
}


Storage, in sd.conf:

Device {
Name = LTO-4
Media Type = LTO-4
Archive Device = /dev/nst0
Changer Device = /dev/sg5
AutomaticMount = yes # when device opened, read it
AlwaysOpen = yes
OfflineOnUnmount = yes
RemovableMedia = yes
RandomAccess = no
Maximum File Size = 5GB
Maximum Block Size = 2048000
Spool Directory = /var/tmp/bacula
Maximum Spool Size = 10GB
Maximum Job Spool Size = 5GB
}


I can read from and write to an already-mounted tape.

I cannot unmount a tape except by stopping the sd and using mt.

I cannot mount a tape except by having it loaded when the sd starts.

This drive worked perfectly in 7.4.7 with this exact configuration.

This is a HP StorageWorks 1760 SAS external LTO-4 drive connected to a
LSI Logic SAS2008 PCI-Express Fusion-MPT SAS-2 (Falcon rev. 02)
controller on a PC running Gentoo Linux and Linux kernel 4.11.6.



--
Phil Stracchino
Babylon Communications
phils@caerllewys.net
phil@co.ordinate.org
Landline: +1.603.293.8485
Mobile: +1.603.998.6958

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users
This message was imported via the External PhorumMail Module
Sorry, only registered users may post in this forum.

Click here to login