Re: [Bacula-users] Getting a LTO8 drive work with Bacula.

2022-04-13 Thread Hector Barrera
Thank you, Martin!

Your suggestion to add the debug level revealed the problem!

btape: block_util.c:316-0 === adata=0 binbuf=524200
btape: block_util.c:577-0 Zero end blk: adata=0 cleared=64 buf_len=524288
wlen=524288 binbuf=524224
btape: block_util.c:361-0 block_header: block_len=524224
btape: block_util.c:377-0 ser_block_header: adata=0 checksum=543943d7
btape: block_util.c:598-0 Enter: bool is_user_volume_size_reached(DCR*,
bool)
btape: block_util.c:625-0 *Maximum volume size 2,000,000,000 *exceeded Vol=
device="IBMLTO8" (/dev/tape/by-id/scsi-35000e111cc2d8001-nst).
Marking Volume "" as Full.
btape: block_util.c:631-0 Return from is_user_volume_size_reached=1
btape: block_util.c:632-0 Leave: bool is_user_volume_size_reached(DCR*,
bool)

For some reason, I had this directive in my bacula-sd.conf file:

*MaximumVolumeSize = 20*

Which is only mostly used for disk-based backups, not for tapes!

Thanks again Martin.

Problem solved.

Cheers!

Hector Barrera.




On Wed, Apr 13, 2022 at 3:41 AM Martin Simmons  wrote:

> I suggest adding the -d200 argument to btape so it prints some debugging
> info.
>
> Also, which driver are you using?  I think you need to avoid the lin_tape
> driver because it doesn't work with Bacula.
>
> __Martin
>
>
> > On Tue, 12 Apr 2022 16:46:55 -0700, Hector Barrera said:
> >
> > Hello Gentlemen,
> >
> > I wonder if any of you had a chance to make an IBM LTO8 Tape Drive work
> > with Bacula 11.0.1
> >
> > Previously we had an IBM LTO7 that worked great, but this new drive is
> not
> > working as expected, the btape test function throws out an error.
> >
> > I followed the Bacula chapter: "Testing Your Tape Drive With Bacula"
> >
> > Here's some information about our setup:
> >
> > *Tape Drive:*
> >
> > [root@bacula02 tmp]# tapeinfo -f /dev/nst0
> > Product Type: Tape Drive
> > Vendor ID: 'IBM '
> > Product ID: 'ULTRIUM-HH8 '
> > Revision: 'N9M1'
> > Attached Changer API: No
> > SerialNumber: '1097012184'
> > MinBlock: 1
> > MaxBlock: 8388608
> > SCSI ID: 1
> > SCSI LUN: 0
> > Ready: yes
> > BufferedMode: yes
> > Medium Type: 0x78
> > Density Code: 0x5c
> > *BlockSize: 0*
> > DataCompEnabled: yes
> > DataCompCapable: yes
> > DataDeCompEnabled: yes
> > CompType: 0xff
> > DeCompType: 0xff
> > BOP: yes
> > Block Position: 0
> > Partition 0 Remaining Kbytes: -1
> > Partition 0 Size in Kbytes: -1
> > ActivePartition: 0
> > EarlyWarningSize: 0
> > NumPartitions: 1
> > MaxPartitions: 3
> > Partition0: 1071
> > Partition1: 57857
> > Partition2: 0
> > Partition3: 0
> >
> > First I thought the problem might be with the block size, but as you can
> > see above, the drive is already to 0
> >
> > *Running the btape test function:*
> >
> > [root@bacula02 tmp]# btape -c /opt/bacula/etc/bacula-sd.conf
> > /dev/tape/by-id/scsi-35000e111cc2d8001-nst
> > Tape block granularity is 1024 bytes.
> > btape: butil.c:295-0 Using device:
> > "/dev/tape/by-id/scsi-35000e111cc2d8001-nst" for writing.
> > btape: btape.c:477-0 open device "IBMLTO8"
> > (/dev/tape/by-id/scsi-35000e111cc2d8001-nst): OK
> > *test
> >
> > === Write, rewind, and re-read test ===
> >
> > I'm going to write 1 records and an EOF
> > then write 1 records and an EOF, then rewind,
> > and re-read the data to verify that it is correct.
> >
> > This is an *essential* feature ...
> >
> > 12-Apr 15:59 btape JobId 0: Re-read of last block succeeded.
> > *btape: btape.c:1156-0 Error writing block to device.*
> > *
> > --
> > Attempting to WEOF a second time claims the tape is in read-only mode:
> >
> > *weof
> > btape: Fatal Error at tape_dev.c:953 because:
> > tape_dev.c:952 Attempt to WEOF on non-appendable Volume
> > 12-Apr 16:25 btape: Fatal Error at tape_dev.c:953 because:
> > tape_dev.c:952 Attempt to WEOF on non-appendable Volume
> > btape: btape.c:607-0 Bad status from weof. *ERR=tape_dev.c:952 Attempt to
> > WEOF on non-appendable Volume*
> >
> >
> > *Our bacula-sd.conf (LTO8 in bold):*
> >
> > Storage {
> >   Name = "bacula02-sd"
> >   SdAddress = **.**.**.**
> >   WorkingDirectory = "/opt/bacula/working"
> >   PidDirectory = "/opt/bacula/working"
> >   PluginDirectory = "/opt/bacula/plugins"
> >   MaximumConcurrentJobs = 20
> > }
> > Device {
> >   Name = "FileChgr1-Dev1"
> >   MediaType = "File1"
> >   ArchiveDevice = "/home/bacula/backups"
> >   RemovableMedia = no
> >   RandomAccess = yes
> >   AutomaticMount = yes
> >   LabelMedia = yes
> >   AlwaysOpen = no
> >   MaximumConcurrentJobs = 5
> > }
> > Device {
> >   Name = "IBMLTO7"
> >   Description = "IBM LTO7 in Library 1 Drive 1"
> >   MediaType = "LTO-7"
> >   DeviceType = "Tape"
> >   ArchiveDevice = "/dev/tape/by-id/scsi-35005076312156b6c-nst"
> >   RemovableMedia = yes
> >   RandomAccess = no
> >   AutomaticMount = yes
> >   LabelMedia = yes
> >   AlwaysOpen = yes
> >   Autochanger = yes
> >   AutoSelect = yes
> >   ChangerDevice = "/dev/tape/by-id/scsi-3500e09efff10c86a"
> >   AlertCommand = "sh -c 'tapeinfo -f %c 

Re: [Bacula-users] Getting a LTO8 drive work with Bacula.

2022-04-13 Thread Martin Simmons
I suggest adding the -d200 argument to btape so it prints some debugging info.

Also, which driver are you using?  I think you need to avoid the lin_tape
driver because it doesn't work with Bacula.

__Martin


> On Tue, 12 Apr 2022 16:46:55 -0700, Hector Barrera said:
> 
> Hello Gentlemen,
> 
> I wonder if any of you had a chance to make an IBM LTO8 Tape Drive work
> with Bacula 11.0.1
> 
> Previously we had an IBM LTO7 that worked great, but this new drive is not
> working as expected, the btape test function throws out an error.
> 
> I followed the Bacula chapter: "Testing Your Tape Drive With Bacula"
> 
> Here's some information about our setup:
> 
> *Tape Drive:*
> 
> [root@bacula02 tmp]# tapeinfo -f /dev/nst0
> Product Type: Tape Drive
> Vendor ID: 'IBM '
> Product ID: 'ULTRIUM-HH8 '
> Revision: 'N9M1'
> Attached Changer API: No
> SerialNumber: '1097012184'
> MinBlock: 1
> MaxBlock: 8388608
> SCSI ID: 1
> SCSI LUN: 0
> Ready: yes
> BufferedMode: yes
> Medium Type: 0x78
> Density Code: 0x5c
> *BlockSize: 0*
> DataCompEnabled: yes
> DataCompCapable: yes
> DataDeCompEnabled: yes
> CompType: 0xff
> DeCompType: 0xff
> BOP: yes
> Block Position: 0
> Partition 0 Remaining Kbytes: -1
> Partition 0 Size in Kbytes: -1
> ActivePartition: 0
> EarlyWarningSize: 0
> NumPartitions: 1
> MaxPartitions: 3
> Partition0: 1071
> Partition1: 57857
> Partition2: 0
> Partition3: 0
> 
> First I thought the problem might be with the block size, but as you can
> see above, the drive is already to 0
> 
> *Running the btape test function:*
> 
> [root@bacula02 tmp]# btape -c /opt/bacula/etc/bacula-sd.conf
> /dev/tape/by-id/scsi-35000e111cc2d8001-nst
> Tape block granularity is 1024 bytes.
> btape: butil.c:295-0 Using device:
> "/dev/tape/by-id/scsi-35000e111cc2d8001-nst" for writing.
> btape: btape.c:477-0 open device "IBMLTO8"
> (/dev/tape/by-id/scsi-35000e111cc2d8001-nst): OK
> *test
> 
> === Write, rewind, and re-read test ===
> 
> I'm going to write 1 records and an EOF
> then write 1 records and an EOF, then rewind,
> and re-read the data to verify that it is correct.
> 
> This is an *essential* feature ...
> 
> 12-Apr 15:59 btape JobId 0: Re-read of last block succeeded.
> *btape: btape.c:1156-0 Error writing block to device.*
> *
> --
> Attempting to WEOF a second time claims the tape is in read-only mode:
> 
> *weof
> btape: Fatal Error at tape_dev.c:953 because:
> tape_dev.c:952 Attempt to WEOF on non-appendable Volume
> 12-Apr 16:25 btape: Fatal Error at tape_dev.c:953 because:
> tape_dev.c:952 Attempt to WEOF on non-appendable Volume
> btape: btape.c:607-0 Bad status from weof. *ERR=tape_dev.c:952 Attempt to
> WEOF on non-appendable Volume*
> 
> 
> *Our bacula-sd.conf (LTO8 in bold):*
> 
> Storage {
>   Name = "bacula02-sd"
>   SdAddress = **.**.**.**
>   WorkingDirectory = "/opt/bacula/working"
>   PidDirectory = "/opt/bacula/working"
>   PluginDirectory = "/opt/bacula/plugins"
>   MaximumConcurrentJobs = 20
> }
> Device {
>   Name = "FileChgr1-Dev1"
>   MediaType = "File1"
>   ArchiveDevice = "/home/bacula/backups"
>   RemovableMedia = no
>   RandomAccess = yes
>   AutomaticMount = yes
>   LabelMedia = yes
>   AlwaysOpen = no
>   MaximumConcurrentJobs = 5
> }
> Device {
>   Name = "IBMLTO7"
>   Description = "IBM LTO7 in Library 1 Drive 1"
>   MediaType = "LTO-7"
>   DeviceType = "Tape"
>   ArchiveDevice = "/dev/tape/by-id/scsi-35005076312156b6c-nst"
>   RemovableMedia = yes
>   RandomAccess = no
>   AutomaticMount = yes
>   LabelMedia = yes
>   AlwaysOpen = yes
>   Autochanger = yes
>   AutoSelect = yes
>   ChangerDevice = "/dev/tape/by-id/scsi-3500e09efff10c86a"
>   AlertCommand = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
>   MaximumBlockSize = 524288
>   MaximumFileSize = 200
>   SpoolDirectory = "/home/bacula/spool"
>   MaximumSpoolSize = 20
> }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> *Device {  Name = "IBMLTO8"  Description = "IBM LTO8 in Library 1 Drive 1"
> MediaType = "LTO-8"  DeviceType = "Tape"  ArchiveDevice =
> "/dev/tape/by-id/scsi-35000e111cc2d8001-nst"  RemovableMedia = yes
> RandomAccess = no  AutomaticMount = yes  LabelMedia = yes  AlwaysOpen =
> yes  Autochanger = yes  AutoSelect = yes  ChangerDevice =
> "/dev/tape/by-id/scsi-1BDT_FlexStor_II_00DE64106938_LL0"  AlertCommand =
> "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"*
> 
> 
> 
> 
> 
> *  MaximumBlockSize = 524288  MaximumVolumeSize = 20
> MaximumFileSize = 20  SpoolDirectory = "/home/bacula/spool"
> MaximumSpoolSize = 20}*
> Messages {
>   Name = "Standard"
>   Director = bacula02-dir = All
> }
> Autochanger {
>   Name = "FileChgr1"
>   Device = "FileChgr1-Dev1"
>   ChangerDevice = "/dev/null"
>   ChangerCommand = ""
> 
> 
> 
> 
> 
> 
> 
> *}Autochanger {  Name = "QUALSTAR-LTO-Lib1"  Description = "Qualstar Q24
> Tape Library"  Device = "IBMLTO8"  ChangerDevice =
> "/dev/tape/by-id/scsi-1BDT_FlexStor_II_00DE64106938_LL0"  ChangerCommand =
> 

Re: [Bacula-users] Getting a LTO8 drive work with Bacula.

2022-04-13 Thread Hector Barrera
Thanks, Gary for replying back.

I used the /dev/nst0 as a shortcut when I typed the command and I use the
/dev/tape/by-id/scsi-35000e111cc2d8001-nst in the bacula-sd.conf file just
in case the tape drive name gets changed by Centos when the server gets
rebooted (it tends to happen on rare occasions), so by using the
dev/tape/by-id/  this assures bacula to always find the tape device name no
matter what.
Nonetheless,.running the tapeinfo command but this time using the
/dev/tape/by-id outputs the same information:

[root@bacula02 ~]# tapeinfo -f /dev/tape/by-id/scsi-35000e111cc2d8001-nst
Product Type: Tape Drive
Vendor ID: 'IBM '
Product ID: 'ULTRIUM-HH8 '
Revision: 'N9M1'
Attached Changer API: No
SerialNumber: '1097012184'
MinBlock: 1
MaxBlock: 8388608
SCSI ID: 1
SCSI LUN: 0
Ready: yes
BufferedMode: yes
Medium Type: 0x78
Density Code: 0x5c
BlockSize: 0
DataCompEnabled: yes
DataCompCapable: yes
DataDeCompEnabled: yes
CompType: 0xff
DeCompType: 0xff
BOP: yes
Block Position: 0
Partition 0 Remaining Kbytes: -1
Partition 0 Size in Kbytes: -1
ActivePartition: 0
EarlyWarningSize: 0
NumPartitions: 1
MaxPartitions: 3
Partition0: 1071
Partition1: 57857
Partition2: 0
Partition3: 0
--

This problem is a weird one, because like I said in my previous email, I'm
able to tar files directly to the tape drive, i.e. tar -cvf /dev/nst0  and
I'm able to extract them back.

If you notice while running the btape test, it appears that the command is
able to write to the drive the first file, then it reads the last block
back without a problem, but when it tries to write a second time, then it
fails:

12-Apr 15:59 btape JobId 0: Re-read of last block succeeded. <---
*btape: btape.c:1156-0 Error writing block to device.*

Is as if the drive is not writing the correct EOF bit at the end of the
file transfer.

Also, there's another command that outputs the drive status:

[root@bacula02 ~]# mt -f /dev/tape/by-id/scsi-35000e111cc2d8001-nst status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x5c (no translation).
Soft error count since last status=0
General status bits on (4101):
 BOT ONLINE IM_REP_EN

Thanks again.

Hector B.


On Tue, Apr 12, 2022 at 7:20 PM Gary R. Schmidt 
wrote:

> On 13/04/2022 09:46, Hector Barrera wrote:
> > Hello Gentlemen,
> >
> > I wonder if any of you had a chance to make an IBM LTO8 Tape Drive work
> > with Bacula 11.0.1
> >
> > Previously we had an IBM LTO7 that worked great, but this new drive is
> > not working as expected, the btape test function throws out an error.
> >
> > I followed the Bacula chapter: "Testing Your Tape Drive With Bacula"
> >
> > Here's some information about our setup:
> >
> > *_Tape Drive:_*
> >
> > [root@bacula02 tmp]# tapeinfo -f /dev/nst0
>
> >ArchiveDevice = "/dev/tape/by-id/scsi-35000e111cc2d8001-nst"
>
> You are referring to things using different names.
>
> What happens if you change them to be consistent?
>
> Cheers,
> GaryB-)
>
>
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Getting a LTO8 drive work with Bacula.

2022-04-12 Thread Gary R. Schmidt

On 13/04/2022 09:46, Hector Barrera wrote:

Hello Gentlemen,

I wonder if any of you had a chance to make an IBM LTO8 Tape Drive work 
with Bacula 11.0.1


Previously we had an IBM LTO7 that worked great, but this new drive is 
not working as expected, the btape test function throws out an error.


I followed the Bacula chapter: "Testing Your Tape Drive With Bacula"

Here's some information about our setup:

*_Tape Drive:_*

[root@bacula02 tmp]# tapeinfo -f /dev/nst0



   ArchiveDevice = "/dev/tape/by-id/scsi-35000e111cc2d8001-nst"


You are referring to things using different names.

What happens if you change them to be consistent?

Cheers,
GaryB-)


___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Getting a LTO8 drive work with Bacula.

2022-04-12 Thread Hector Barrera
Hello Gentlemen,

I wonder if any of you had a chance to make an IBM LTO8 Tape Drive work
with Bacula 11.0.1

Previously we had an IBM LTO7 that worked great, but this new drive is not
working as expected, the btape test function throws out an error.

I followed the Bacula chapter: "Testing Your Tape Drive With Bacula"

Here's some information about our setup:

*Tape Drive:*

[root@bacula02 tmp]# tapeinfo -f /dev/nst0
Product Type: Tape Drive
Vendor ID: 'IBM '
Product ID: 'ULTRIUM-HH8 '
Revision: 'N9M1'
Attached Changer API: No
SerialNumber: '1097012184'
MinBlock: 1
MaxBlock: 8388608
SCSI ID: 1
SCSI LUN: 0
Ready: yes
BufferedMode: yes
Medium Type: 0x78
Density Code: 0x5c
*BlockSize: 0*
DataCompEnabled: yes
DataCompCapable: yes
DataDeCompEnabled: yes
CompType: 0xff
DeCompType: 0xff
BOP: yes
Block Position: 0
Partition 0 Remaining Kbytes: -1
Partition 0 Size in Kbytes: -1
ActivePartition: 0
EarlyWarningSize: 0
NumPartitions: 1
MaxPartitions: 3
Partition0: 1071
Partition1: 57857
Partition2: 0
Partition3: 0

First I thought the problem might be with the block size, but as you can
see above, the drive is already to 0

*Running the btape test function:*

[root@bacula02 tmp]# btape -c /opt/bacula/etc/bacula-sd.conf
/dev/tape/by-id/scsi-35000e111cc2d8001-nst
Tape block granularity is 1024 bytes.
btape: butil.c:295-0 Using device:
"/dev/tape/by-id/scsi-35000e111cc2d8001-nst" for writing.
btape: btape.c:477-0 open device "IBMLTO8"
(/dev/tape/by-id/scsi-35000e111cc2d8001-nst): OK
*test

=== Write, rewind, and re-read test ===

I'm going to write 1 records and an EOF
then write 1 records and an EOF, then rewind,
and re-read the data to verify that it is correct.

This is an *essential* feature ...

12-Apr 15:59 btape JobId 0: Re-read of last block succeeded.
*btape: btape.c:1156-0 Error writing block to device.*
*
--
Attempting to WEOF a second time claims the tape is in read-only mode:

*weof
btape: Fatal Error at tape_dev.c:953 because:
tape_dev.c:952 Attempt to WEOF on non-appendable Volume
12-Apr 16:25 btape: Fatal Error at tape_dev.c:953 because:
tape_dev.c:952 Attempt to WEOF on non-appendable Volume
btape: btape.c:607-0 Bad status from weof. *ERR=tape_dev.c:952 Attempt to
WEOF on non-appendable Volume*


*Our bacula-sd.conf (LTO8 in bold):*

Storage {
  Name = "bacula02-sd"
  SdAddress = **.**.**.**
  WorkingDirectory = "/opt/bacula/working"
  PidDirectory = "/opt/bacula/working"
  PluginDirectory = "/opt/bacula/plugins"
  MaximumConcurrentJobs = 20
}
Device {
  Name = "FileChgr1-Dev1"
  MediaType = "File1"
  ArchiveDevice = "/home/bacula/backups"
  RemovableMedia = no
  RandomAccess = yes
  AutomaticMount = yes
  LabelMedia = yes
  AlwaysOpen = no
  MaximumConcurrentJobs = 5
}
Device {
  Name = "IBMLTO7"
  Description = "IBM LTO7 in Library 1 Drive 1"
  MediaType = "LTO-7"
  DeviceType = "Tape"
  ArchiveDevice = "/dev/tape/by-id/scsi-35005076312156b6c-nst"
  RemovableMedia = yes
  RandomAccess = no
  AutomaticMount = yes
  LabelMedia = yes
  AlwaysOpen = yes
  Autochanger = yes
  AutoSelect = yes
  ChangerDevice = "/dev/tape/by-id/scsi-3500e09efff10c86a"
  AlertCommand = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
  MaximumBlockSize = 524288
  MaximumFileSize = 200
  SpoolDirectory = "/home/bacula/spool"
  MaximumSpoolSize = 20
}














*Device {  Name = "IBMLTO8"  Description = "IBM LTO8 in Library 1 Drive 1"
MediaType = "LTO-8"  DeviceType = "Tape"  ArchiveDevice =
"/dev/tape/by-id/scsi-35000e111cc2d8001-nst"  RemovableMedia = yes
RandomAccess = no  AutomaticMount = yes  LabelMedia = yes  AlwaysOpen =
yes  Autochanger = yes  AutoSelect = yes  ChangerDevice =
"/dev/tape/by-id/scsi-1BDT_FlexStor_II_00DE64106938_LL0"  AlertCommand =
"sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"*





*  MaximumBlockSize = 524288  MaximumVolumeSize = 20
MaximumFileSize = 20  SpoolDirectory = "/home/bacula/spool"
MaximumSpoolSize = 20}*
Messages {
  Name = "Standard"
  Director = bacula02-dir = All
}
Autochanger {
  Name = "FileChgr1"
  Device = "FileChgr1-Dev1"
  ChangerDevice = "/dev/null"
  ChangerCommand = ""







*}Autochanger {  Name = "QUALSTAR-LTO-Lib1"  Description = "Qualstar Q24
Tape Library"  Device = "IBMLTO8"  ChangerDevice =
"/dev/tape/by-id/scsi-1BDT_FlexStor_II_00DE64106938_LL0"  ChangerCommand =
"/opt/bacula/scripts/mtx-changer %c %o %S %a %d"}*
Autochanger {
  Name = "QUANTUM-LTO-Lib1"
  Description = "Quantum SuperLoader 3"
  Device = "IBMLTO7"
  ChangerDevice = "/dev/tape/by-id/scsi-3500e09efff10c86a"
  ChangerCommand = "/opt/bacula/scripts/mtx-changer %c %o %S %a %d"
}
---

I should mention that running this actually works:

mt -f /dev/nst0 rewind
tar -cvf /dev/nst0 .
mt -f /dev/nst0 rewind
tar -xvf /dev/nst0

Running the tar directly to the tape drive works.
I was able to tar several files and extract them without a problem.
So the problem seems to be with my bacula configuration.

Please