Re: [Bacula-users] Problems getting a tape library to work under FreeBSD

2018-02-01 Thread Dan Langille
> On Feb 1, 2018, at 6:42 PM, Kenneth Garges  wrote:
> 
> This is really weird. 
> 
> First mtx works:
> 
> # mtx -f /dev/pass42 status
>   Storage Changer /dev/pass42:2 Drives, 54 Slots ( 5 Import/Export )
> Data Transfer Element 0:Empty
> Data Transfer Element 1:Full (Storage Element 1 Loaded):VolumeTag = 000600
>   
>   Storage Element 1:Empty:VolumeTag=
>   Storage Element 2:Empty:VolumeTag=
>   Storage Element 3:Empty:VolumeTag=
>   Storage Element 4:Empty:VolumeTag=
>   Storage Element 5:Empty:VolumeTag=
>   Storage Element 6:Empty:VolumeTag=
>   Storage Element 7:Empty:VolumeTag=
>   Storage Element 8:Empty:VolumeTag=
>   Storage Element 9:Empty:VolumeTag=
>   Storage Element 10:Empty:VolumeTag=
>   Storage Element 11:Empty:VolumeTag=
>   Storage Element 12:Empty:VolumeTag=
>   Storage Element 13:Empty:VolumeTag=
>   Storage Element 14:Empty:VolumeTag=
>   Storage Element 15:Full :VolumeTag=B1  
>   Storage Element 16:Full :VolumeTag=B2  
>   Storage Element 17:Full :VolumeTag=B3  
>   Storage Element 18:Full :VolumeTag=B4  
>   Storage Element 19:Empty:VolumeTag=
>   Storage Element 20:Empty:VolumeTag=
>   Storage Element 21:Empty:VolumeTag=
>   Storage Element 22:Empty:VolumeTag=
>   Storage Element 23:Empty:VolumeTag=
>   Storage Element 24:Full :VolumeTag=B5  
>   Storage Element 25:Empty:VolumeTag=
>   Storage Element 26:Empty:VolumeTag=
>   Storage Element 27:Empty:VolumeTag=
>   Storage Element 28:Empty:VolumeTag=
>   Storage Element 29:Empty:VolumeTag=
>   Storage Element 30:Empty:VolumeTag=
>   Storage Element 31:Empty:VolumeTag=
>   Storage Element 32:Empty:VolumeTag=
>   Storage Element 33:Empty:VolumeTag=
>   Storage Element 34:Empty:VolumeTag=
>   Storage Element 35:Empty:VolumeTag=
>   Storage Element 36:Empty:VolumeTag=
>   Storage Element 37:Empty:VolumeTag=
>   Storage Element 38:Empty:VolumeTag=
>   Storage Element 39:Empty:VolumeTag=
>   Storage Element 40:Empty:VolumeTag=
>   Storage Element 41:Empty:VolumeTag=
>   Storage Element 42:Empty:VolumeTag=
>   Storage Element 43:Empty:VolumeTag=
>   Storage Element 44:Empty:VolumeTag=
>   Storage Element 45:Empty:VolumeTag=
>   Storage Element 46:Empty:VolumeTag=
>   Storage Element 47:Empty:VolumeTag=
>   Storage Element 48:Empty:VolumeTag=
>   Storage Element 49:Empty:VolumeTag=
>   Storage Element 50 IMPORT/EXPORT:Empty:VolumeTag=   
>  
>   Storage Element 51 IMPORT/EXPORT:Empty:VolumeTag=   
>  
>   Storage Element 52 IMPORT/EXPORT:Empty:VolumeTag=   
>  
>   Storage Element 53 IMPORT/EXPORT:Empty:VolumeTag=   
>  
>   Storage Element 54 IMPORT/EXPORT:Empty:VolumeTag=   
>  
> 
> Try it again immediately afterwards and it doesn’t:

I suspect timing.  Set the sleep option in mtx-changer's config

It can take a while for a tape to settle and for the tape drive to be ready.
-- 
Dan Langille - BSDCan / PGCon
d...@langille.org




> 
> # mtx -f /dev/pass42 status
> RequestSense (0x03) failed
> mtx: Request Sense: Long Report=yes
> mtx: Request Sense: Valid Residual=no
> mtx: Request Sense: Error Code=0 (Unknown?!)
> mtx: Request Sense: Sense Key

Re: [Bacula-users] Problems getting a tape library to work under FreeBSD

2018-02-01 Thread Kenneth Garges

> On 31Jan 2018, at 12:57 AM, Cejka Rudolf  wrote:
> 
> Kenneth Garges wrote (2018/01/30):
>> I???m having trouble getting a tape library to work.
> 
> Hello, try chio status -v or mtx status. Both should return
> status of your autochanger including tape labels. If they both
> do return an error, do you have correct permissons on /dev/ch*?
> I have the following (please note the operator group):
> 
> bacula> ls -l /dev/ch*
> crw-rw  1 root  operator  0x9e 11 led 11:31 /dev/ch0
> bacula> id bacula
> uid=366(bacula) gid=366(bacula) groups=366(bacula),0(wheel),5(operator)
> 
> If mtx returns an error but chio does work, please try chio-changer-freebsd,
> which uses FreeBSD's native chio instead of mtx from ports.
> 
> -- 
> Rudolf Cejka  http://www.fit.vutbr.cz/~cejkar
> Brno University of Technology, Faculty of Information Technology
> Bozetechova 2, 612 66  Brno, Czech Republic



I tried chio but gave up on it because anything I did gave an "Inappropriate 
ioctl for device" error. Now that a reboot seems to have gotten mtx working I 
found that chio works too. 
--
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


Re: [Bacula-users] Problems getting a tape library to work under FreeBSD

2018-02-01 Thread Kenneth Garges
Thanks for all the suggestions.

> On 30Jan 2018, at 8:03 PM, Dan Langille  wrote:
> 
>> On Jan 30, 2018, at 10:23 PM, Kenneth Garges > > wrote:
>> 
>> I’m having trouble getting a tape library to work. Individual tape drive 
>> seems ok but the library sometimes makes btape hang requiring a reboot. Or 
>> it fails.
> 
> Fix that first.

I’m not sure how to fix it. Sometimes it just gets wedged into this state where 
even running mtx status will fail with Inquiry Command failed. Then a reboot 
and it works. For a while. Then something happens and it’s wedged again.



>> 
>> My system is FreeBSD 10.3-RELEASE-p24. I compiled bacula-9.0.6 from source. 
>> I have a Quantum Scalar i80 tape library with an LTO-4 drive attached via 
>> fiber channel. 
> 
> If you can I suggest using the packages.  It's what I do.  I am also the 
> FreeBSD packager.
> 
> I do not think this is the cause of the issues.
> 

I wanted to use a package but could not find any that had both psql and openssl 
options. 

>> 
>> #
>> # Define a Virtual autochanger
>> #
>> Autochanger {
>>  Name = FileChgr1
>>  Device = FileChgr1-Dev1, FileChgr1-Dev2
>>  Changer Command = ""
>>  Changer Device = /dev/null
>> }
> 
> I suggest trying must one Device in here for now.

Yes that’s what I’m doing with the tape library device. The second tape drive 
is commented out.


>> 
>> # btape -c /etc/bacula/bacula-sd.conf -v -d 99 /dev/nsa0
>> Tape block granularity is 1024 bytes.
>> btape: address_conf.c:274-0 Initaddr 0.0.0.0:9103 
>> btape: butil.c:290-0 Using device: "/dev/nsa0" for writing.
>> btape: autochanger.c:328-0 Locking changer core-prod-jb-2
>> 30-Jan 19:08 btape JobId 0: 3301 Issuing autochanger "loaded? drive 0" 
>> command.
>> btape: autochanger.c:284-0 Run program=/usr/local/etc/bacula/mtx-changer 
>> /dev/pass42 loaded 0 /dev/nsa0 0
>> btape: autochanger.c:286-0 run_prog: /usr/local/etc/bacula/mtx-changer 
>> /dev/pass42 loaded 0 /dev/nsa0 0 stat=268435457 result=RequestSense (0x03) 
>> failed
> 
> I think you need more testing on the command line with mtx-changer. See below.
> …

Yeah all those errors happened when it was wedged. I didn’t realize it. After a 
reboot they work. 


> 
> I have documented most of my setup procedure on FreeBSD.
> 
> Getting mtx working first.  Then mtx-changers.  Verify permissions on devices 
> for the bacula user.
> 
> These might help, based on 
> https://dan.langille.org/?s=mtx-changer&searchsubmit= 
> 
> 
> https://dan.langille.org/2016/02/04/dell-tl4000-tape-library-running-btape-and-configuring-baculas-mtx-changer/
>  
> 
> 
> This example has more on permissions:
> 
> https://www.freebsddiary.org/tape-library-integration.php 
> 
> 
> Hope that gets you started.
> 
> -- 
> Dan Langille - BSDCan / PGCon
> d...@langille.org 

Thanks for your efforts documenting all this. I have read most if not all of it.


--
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


Re: [Bacula-users] Number of files mismatch!

2018-02-01 Thread krashoverride
Hello Martin,

Sure, next time the problem occurs. It has not since, lets say 1 week. Last 
time i had it, I tried to only restart bacula-sd service, and restarted my 
backup, that worked like a charm.

I'll let you know!

Thank you

-- Thib

- Mail original -
De: "Martin Simmons" 
À: krashoverr...@free.fr
Cc: itli...@igtp.cat, bacula-users@lists.sourceforge.net
Envoyé: Jeudi 25 Janvier 2018 17:13:35
Objet: Re: [Bacula-users] Number of files mismatch!

Can you post the output of the 'bls -j /dev/nst0' shell command with one of
these "empty" tapes in the drive?

__Martin


> On Wed, 24 Jan 2018 21:04:06 +0100 (CET), krashoverride  said:
> 
> Feedback again, umount / mount has no effect.
> Tapes are seen as empty.
> 
> Total Bytes Read=64,512 Blocks Read=1 Bytes/block=64,512
> Positioned at File=0 Block=0
> 
> I don't know where to dig, now.
> 
> - Mail original -
> De: krashoverr...@free.fr
> À: "itlinux_igtp" 
> Cc: bacula-users@lists.sourceforge.net
> Envoyé: Mardi 23 Janvier 2018 21:24:34
> Objet: Re: [Bacula-users] Number of files mismatch!
> 
> Good evening Iñaki,
> 
> Quick feedback : new package of tapes came, error persists.
> It "seems" if I umount / mount my tape, error is gone.
> I've tested right now, after being mailed file mismatch :
> 1. cancel job
> 2. update volume status from error to append
> 3. umount
> 4. mount
> 5. manually run the job that starts successfully.
> 
> I'm gonna wait for the backup catalog in 2 hours, to see if it starts 
> successfully
> 
> - Mail original -
> De: "itlinux_igtp" 
> À: bacula-users@lists.sourceforge.net
> Envoyé: Lundi 22 Janvier 2018 09:40:58
> Objet: Re: [Bacula-users] Number of files mismatch!
> 
> You might have a bad batch. It happened to me a while ago, weird issues 
> with backups until I swapped tapes from a different batch and everything 
> worked. If the tapes you are using come from the same package/batch I 
> wouldn't discard that option. If you can test the backup with a known 
> good tape, that would help you troubleshoot this.
> 
> PS: For LTO tapes you should have Random Access = no
> 
> Regards,
> Iñaki
> On 01/22/2018 09:11 AM, krashoverr...@free.fr wrote:
> > Good morning here!
> >
> > About this problem, i've set my Q003 tape on quarantine, because of this 
> > "file mismatch" problem
> > I've created a Q004 tape, that ran successfully this weekend, until the 
> > catalog backup :
> > The number of files mismatch! Volume=0 Catalog=2464
> > Do I have to consider that I have bad luck with 2 "bad tapes" ? Do I have 
> > to force something in SD conf ?
> >
> > (BTW, how "files" are working ? I backup 2.461 TB and I have 2.464 files, 1 
> > files per giga ?)
> >
> > Thank you!
> >
> > -- Thib
> >
> >
> > - Mail original -
> > De: "Kern Sibbald" 
> > À: krashoverr...@free.fr, bacula-users@lists.sourceforge.net
> > Envoyé: Mercredi 17 Janvier 2018 09:44:35
> > Objet: Re: [Bacula-users] Number of files mismatch!
> >
> > Your tape seems to be bad or overwritten.
> >
> > I suggest to try a bls on the tape and see if it really has any data on
> > it.  The Bacula SD thinks the tape is empty.
> >
> >
> > On 16.01.2018 08:22, krashoverr...@free.fr wrote:
> >> Hi again,
> >>
> >> Quick feedback, yesterday while I was writing this mail, i started again 
> >> my bscan + change volume status process, then started again my 
> >> differential backup on the same Q003 tape. Backup is successful this 
> >> morning.
> >>
> >> - Mail original -
> >> De: krashoverr...@free.fr
> >> À: bacula-users@lists.sourceforge.net
> >> Envoyé: Lundi 15 Janvier 2018 21:47:11
> >> Objet: [Bacula-users] Number of files mismatch!
> >>
> >> Good evening here,
> >>
> >> I'm having an issue with the number of files that does not match between 
> >> the tape and the DB
> >> Number of files on the tape is zero, while the tape isn't empty.
> >> I'm using bacula-dir / bacula-sd 7.4.4 on a virtualized debian 9 server 
> >> (SQLite database)
> >>
> >> 15-Jan 21:00 xxx-dir JobId 54: Using Device "Lecteur_LTO6" to write.
> >> 15-Jan 21:00 xxx-sd JobId 54: Volume "Q003" previously written, moving to 
> >> end of data.
> >> 15-Jan 21:01 xxx-sd JobId 54: Error: Bacula cannot write on tape Volume 
> >> "Q003" because:
> >> The number of files mismatch! Volume=0 Catalog=132
> >> 15-Jan 21:01 xxx-sd JobId 54: Marking Volume "Q003" in Error in Catalog.
> >>
> >> I've had this error yesterday evening, that i thought i fixed with a bscan 
> >> command, that listed me jobs / files on tape correctly
> >> After this bscan, i've changed the status of the volume from Error to 
> >> Append, and started a catalog backup job, that ran successfully on tape 
> >> Q003. Then, this evening, error again.
> >>
> >> Knowing that I have for now a total of 5 tapes in my bacula, and i've had 
> >> no problems for any other tape but Q003, do I have to consider that the 
> >> tape is faulty ?
> >>
> >> Also, i've read topics about the two directives "BSF at EOM" and