This is getting weirder.  The mt eof, rewind and status commands work.  The tar 
command failed.

root@dl160g11:/opt/bacula/etc# mt -f /dev/st0 eof
root@dl160g11:/opt/bacula/etc# mt -f /dev/nst0 rewind
root@dl160g11:/opt/bacula/etc# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x5c (LTO-7).
Soft error count since last status=0
General status bits on (41010000):
BOT ONLINE IM_REP_EN
root@dl160g11:/opt/bacula/etc# tar zcf /dev/nst0 /opt/bacula ; echo "Error 
code: $?"
tar: Removing leading `/' from member names
tar (child): /dev/nst0: Cannot write: Input/output error
tar (child): Error is not recoverable: exiting now
tar: /dev/nst0: Wrote only 4096 of 10240 bytes
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Error code: 2

I'm wondering if I need to try something other than Ubuntu 22.04.

Doug

On Fri, Sep 16, 2022, at 10:39 PM, Charles Tassell wrote:
> Hmm, that's odd that the mt commands work but the  btape doesn't...  I'm 
> wondering if the mt commands just aren't reporting an error.  Try 
> writing a small volume with tar:
> 
> tar zcf /dev/nst0 /etc/skel ; echo "Error code: $?"
> 
> 
> On 2022-09-16 23:33, Doug Eubanks wrote:
> > The mt commands run fine.  The btape command gives a similar error.
> > root@dl160g11:/opt/bacula/etc# ../bin/btape -c 
> > /opt/bacula/etc/bacula-sd.conf /dev/nst0
> > Tape block granularity is 1024 bytes.
> > btape: butil.c:295-0 Using device: "/dev/nst0" for writing.
> > btape: btape.c:477-0 open device "LTO-7" (/dev/nst0): OK
> > *test
> >
> > === Write, rewind, and re-read test ===
> >
> > I'm going to write 10000 records and an EOF
> > then write 10000 records and an EOF, then rewind,
> > and re-read the data to verify that it is correct.
> >
> > This is an *essential* feature ...
> >
> > btape: block.c:291-0 [SE0201] Write error at 0:0 on device "LTO-7" 
> > (/dev/nst0) Vol=. ERR=Input/output error.
> > 17-Sep 02:32 btape JobId 0: Error: block.c:291 [SE0201] Write error at 0:0 
> > on device "LTO-7" (/dev/nst0) Vol=. ERR=Input/output error.
> > 17-Sep 02:32 btape JobId 0: Error: Backspace record at EOT failed. 
> > ERR=Input/output error
> > btape: btape.c:1156-0 Error writing block to device.
> > *quit
> >
> > Doug
> >
> > On Fri, Sep 16, 2022, at 10:01 AM, Charles Tassell wrote:
> >> Hi Doug,
> >>
> >>    Hmm, that looks fine.  Try the following:
> >>
> >> mt -f /dev/nst0 status
> >> mt -f /dev/nst0 rewind
> >> mt -f /dev/st0 eof
> >> mt -f /dev/nst0 rewind
> >> btape -c /opt/bacula/etc/bacula-sd.conf /dev/nst0
> >>
> >>
> >> On 2022-09-16 10:55, Doug Eubanks wrote:
> >>> Here's the requested output.
> >>>
> >>> bacula@dl160g11:/home/douge$ ls -dl /dev/nst* /dev/sg*
> >>> groups
> >>> mtx -f /dev/sg3 status
> >>> crwxrwx--- 1 root tape  9, 128 Sep 15 15:14 /dev/nst0
> >>> crwxrwx--- 1 root tape  9, 224 Sep 15 15:14 /dev/nst0a
> >>> crwxrwx--- 1 root tape  9, 160 Sep 15 15:14 /dev/nst0l
> >>> crwxrwx--- 1 root tape  9, 192 Sep 15 15:14 /dev/nst0m
> >>> crw------- 1 root root 21,   0 Sep 15 15:14 /dev/sg0
> >>> crw-rw---- 1 root disk 21,   1 Sep 15 15:14 /dev/sg1
> >>> crw-rw---- 1 root tape 21,   2 Sep 15 15:14 /dev/sg2
> >>> crw-rw---- 1 root tape 21,   3 Sep 15 15:14 /dev/sg3
> >>> bacula tape
> >>>     Storage Changer /dev/sg3:1 Drives, 8 Slots ( 0 Import/Export )
> >>> Data Transfer Element 0:Full (Storage Element 1 Loaded):VolumeTag = 
> >>> ABT001L7
> >>>         Storage Element 1:Empty
> >>>         Storage Element 2:Full :VolumeTag=2018-2L7
> >>>         Storage Element 3:Full :VolumeTag=ABT005L7
> >>>         Storage Element 4:Full :VolumeTag=ABT012L7
> >>>         Storage Element 5:Empty
> >>>         Storage Element 6:Empty
> >>>         Storage Element 7:Empty
> >>>         Storage Element 8:Full
> >>>
> >>> Doug
> >>>
> >>> On Fri, Sep 16, 2022, at 9:18 AM, Charles Tassell wrote:
> >>>> Hi Doug,
> >>>>
> >>>>     Try running the following and posting the output:
> >>>> su -s /bin/bash bacula
> >>>> ls -dl /dev/nst* /dev/sg*
> >>>> groups
> >>>> mtx -f /dev/sg3 status
> >>>> exit
> >>>>
> >>>>     That will switch you to the bacula user, check the permissions of the
> >>>> various devices, and attempt to run the mtx command as the bacula user.
> >>>>
> >>>> On 2022-09-16 09:37, Doug Eubanks wrote:
> >>>>> Good morning, thank you for your reply.
> >>>>>
> >>>>> The bacula user is definitely in the tape group.
> >>>>>
> >>>>> root@dl160g11:/opt/bacula/bin# mtx -f /dev/sg3 status
> >>>>>
> >>>>>      Storage Changer /dev/sg3:1 Drives, 8 Slots ( 0 Import/Export )
> >>>>> Data Transfer Element 0:Full (Storage Element 1 Loaded):VolumeTag = 
> >>>>> ABT001L7
> >>>>>          Storage Element 1:Empty
> >>>>>          Storage Element 2:Full :VolumeTag=2018-2L7
> >>>>>          Storage Element 3:Full :VolumeTag=ABT005L7
> >>>>>          Storage Element 4:Full :VolumeTag=ABT012L7
> >>>>>          Storage Element 5:Empty
> >>>>>          Storage Element 6:Empty
> >>>>>          Storage Element 7:Empty
> >>>>>          Storage Element 8:Full
> >>>>>
> >>>>> I do believe this is probably a permission issue, but I'm not sure what 
> >>>>> the correct way to resolve it is.
> >>>>>
> >>>>> Doug
> >>>>>
> >>>>> On Thu, Sep 15, 2022, at 12:04 PM, Charles Tassell wrote:
> >>>>>> Hi Doug,
> >>>>>>
> >>>>>>      Is bacula running as root?  On most setups it runs as the bacula
> >>>>>> user, so you would need to make sure that that user is in the "tape"
> >>>>>> group and has rw access to /dev/nst0.
> >>>>>>
> >>>>>> On 2022-09-15 12:17, Doug Eubanks via Bacula-users wrote:
> >>>>>>> Hello!
> >>>>>>>
> >>>>>>> I'm setting up an HP autochanger with an LTO-7 drive with Bacula on 
> >>>>>>> Ubuntu 22.04 server at home.  I've been able to run mt and mtx 
> >>>>>>> commands successfully to erase a tape and change the loaded tape.
> >>>>>>>
> >>>>>>> I've installed Bacula 13.0.1 using apt-get from the repo.  I also 
> >>>>>>> installed Bacularis for a GUI, but that isn't relevant to this issue. 
> >>>>>>>  I've searched Google and the mailing list archive and while I've 
> >>>>>>> seen others experiencing the same problem from over a decade ago, I 
> >>>>>>> haven't found a fix.
> >>>>>>>
> >>>>>>> I'm not sure if I am missing some udev rules or if it's something 
> >>>>>>> else.
> >>>>>>>
> >>>>>>> When I try to run the btape test, I get this output.
> >>>>>>> ./btape -c ../etc/bacula-sd.conf /dev/nst0
> >>>>>>> Tape block granularity is 1024 bytes.
> >>>>>>> btape: butil.c:295-0 Using device: "/dev/nst0" for writing.
> >>>>>>> btape: btape.c:477-0 open device "LTO-7" (/dev/nst0): OK
> >>>>>>> *test
> >>>>>>>
> >>>>>>> === Write, rewind, and re-read test ===
> >>>>>>>
> >>>>>>> I'm going to write 10000 records and an EOF
> >>>>>>> then write 10000 records and an EOF, then rewind,
> >>>>>>> and re-read the data to verify that it is correct.
> >>>>>>>
> >>>>>>> This is an *essential* feature ...
> >>>>>>>
> >>>>>>> btape: block.c:291-0 [SE0201] Write error at 0:0 on device "LTO-7" 
> >>>>>>> (/dev/nst0) Vol=. ERR=Input/output error.
> >>>>>>> 15-Sep 15:11 btape JobId 0: Error: block.c:291 [SE0201] Write error 
> >>>>>>> at 0:0 on device "LTO-7" (/dev/nst0) Vol=. ERR=Input/output error.
> >>>>>>> 15-Sep 15:12 btape JobId 0: Error: Backspace record at EOT failed. 
> >>>>>>> ERR=Input/output error
> >>>>>>> btape: btape.c:1156-0 Error writing block to device.
> >>>>>>>
> >>>>>>> Here's my bacula-sd.conf configuration:
> >>>>>>>
> >>>>>>> Device {
> >>>>>>>       Name = "LTO-7"
> >>>>>>>       Description = "LTO-7"
> >>>>>>>       MediaType = "LTO-7"
> >>>>>>>       DeviceType = "Tape"
> >>>>>>>       ArchiveDevice = "/dev/nst0"
> >>>>>>>       AutomaticMount = yes
> >>>>>>>       Autochanger = yes
> >>>>>>>       RemovableMedia = yes;
> >>>>>>>       RandomAccess = no;
> >>>>>>>       AlwaysOpen = yes;
> >>>>>>>       ChangerDevice = "/dev/sg3"
> >>>>>>>       ChangerCommand = "/opt/bacula/scripts/mtx-changer %c %o %S %a 
> >>>>>>> %d"
> >>>>>>>       AlertCommand = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
> >>>>>>>       MaximumFileSize = 100G
> >>>>>>>       LabelType = "Bacula"
> >>>>>>>       LabelMedia = yes
> >>>>>>> }
> >>>>>>>
> >>>>>>> Autochanger {
> >>>>>>>       Name = "LTO-7 Autochanger"
> >>>>>>>       Description = "LTO-7"
> >>>>>>>       Device = "LTO-7"
> >>>>>>>       ChangerDevice = "/dev/sg3"
> >>>>>>>       ChangerCommand = "/opt/bacula/scripts/mtx-changer %c %o %S %a 
> >>>>>>> %d"
> >>>>>>> }
> >>>>>>>
> >>>>>>>
> >>>>>>> Any assistance would be greatly appreciated,
> >>>>>>> Doug
> >>>>>>>
> >>>>>>>
> >>>>>>> _______________________________________________
> >>>>>>> Bacula-users mailing list
> >>>>>>> Bacula-users@lists.sourceforge.net
> >>>>>>> https://lists.sourceforge.net/lists/listinfo/bacula-users
> >>>>> Sincerely,
> >>>>> Doug Eubanks
> >>>>> http://www.dougeubanks.com
> >>>>> Amateur Radio Operator: K1DUG
> >>>>> North Carolina Emergency Medical Technician
> >>>>> AWS Certified Cloud Practitioner
> >>>>> (919) 901-0705 (Cell - Preferred)
> >>>>> ‪(919) 679-1725 (Home)
> >>>>
> >>> Sincerely,
> >>> Doug Eubanks
> >>> http://www.dougeubanks.com
> >>> Amateur Radio Operator: K1DUG
> >>> North Carolina Emergency Medical Technician
> >>> AWS Certified Cloud Practitioner
> >>> (919) 901-0705 (Cell - Preferred)
> >>> ‪(919) 679-1725 (Home)
> >>
> >>
> > Sincerely,
> > Doug Eubanks
> > http://www.dougeubanks.com
> > Amateur Radio Operator: K1DUG
> > North Carolina Emergency Medical Technician
> > AWS Certified Cloud Practitioner
> > (919) 901-0705 (Cell - Preferred)
> > ‪(919) 679-1725 (Home)
> 
> 
> 

Sincerely,
Doug Eubanks
http://www.dougeubanks.com
Amateur Radio Operator: K1DUG
North Carolina Emergency Medical Technician
AWS Certified Cloud Practitioner
(919) 901-0705 (Cell - Preferred)
‪(919) 679-1725 (Home)


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

Reply via email to