View Issue Details

IDProjectCategoryView StatusLast Update
0000592bareos-corestorage daemonpublic2023-05-15 10:31
Reporteruser256Assigned Tobruno-at-bareos  
PriorityurgentSeverityblockReproducibilityalways
Status closedResolutionno change required 
PlatformLinuxOSopenSUSEOS VersionLeap 42.1
Product Version15.2.2 
Summary0000592: Label command always failing for LTO-2 tape
DescriptionNo matter what I do, I always get a failure when trying to label a tape in bconsole.

Using Bacula 5.2.13 with the same tape on the same system labels the tape without problem.
Steps To Reproduce1. Insert tape into device and run:
# mt -f /dev/nst0 rewind; mt -f /dev/nst0 weof; mt -f /dev/nst0 rewind

2. Run bconsole

Connecting to Director i7:9101
1000 OK: i7-dir Version: 15.2.2 (16 November 2015)
Enter a period to cancel a command.

3. Execute label command:

*label storage=LTO-2 volume=BackupTape1 pool=DailyPool
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Connecting to Storage daemon LTO-2 at i7:9103 ...
Sending label command for Volume "BackupTape1" Slot 0 ...
block.c:630 Write error at 0:0 on device "LTO-2" (/dev/nst0). ERR=Invalid argument.
block.c:644 Write error on fd=4 at file:blk 0:0 on device "LTO-2" (/dev/nst0). ERR=Invalid argument.
Backspace record at EOT failed. ERR=Input/output error
3912 Failed to label Volume: ERR=generic_tape_device.c:726 ioctl MTBSR error on "LTO-2" (/dev/nst0). ERR=Input/output error.

Label command failed for Volume BackupTape1.
Do not forget to mount the drive!!!
*
Additional InformationI have been forwarded here from a discussion in the mailing list:

https://groups.google.com/d/topic/bareos-users/sey025rfwUo/discussion

Note:

Backup to HDD works without problem using the same .conf files.

I also tried restoring some files from another tape (which have been backed up with Bacula) - no problem too. The problem is only with tape labeling which also prevents me from testing actual tape backup in Bareos.
TagsNo tags attached.

Activities

user256

2016-01-07 11:10

 

bareos-label-failure.txt (22,014 bytes)   
############################################################
# In bareos-sd.conf I have:
############################################################

Device { 
 Name = LTO-2 
 Media Type = LTO-2 
 Archive Device = /dev/nst0 
 AutomaticMount = yes;
 AlwaysOpen = yes; 
 RemovableMedia = yes; 
 RandomAccess = no; 
 Maximum File Size = 100GB 
 Maximum Network Buffer Size = 65536
}

############################################################
# And in bareos-dir.conf I have:
############################################################

Pool {
  Name = DailyPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1 year
  Maximum Volume Bytes = 400G
  Maximum Volumes = 10
}

############################################################
# Running btape:
############################################################

# btape -c /etc/bareos/bareos-sd.conf LTO-2
Tape block granularity is 1024 bytes.
btape: butil.c:274-0 Using device: "LTO-2" for writing.
btape: btape.c:487-0 open device "LTO-2" (/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: btape.c:1172-0 Wrote 10000 blocks of 64412 bytes.
btape: btape.c:619-0 Wrote 1 EOF to "LTO-2" (/dev/nst0)
btape: btape.c:1188-0 Wrote 10000 blocks of 64412 bytes.
btape: btape.c:619-0 Wrote 1 EOF to "LTO-2" (/dev/nst0)
btape: btape.c:1230-0 Rewind OK.
10000 blocks re-read correctly.
Got EOF on tape.
10000 blocks re-read correctly.
=== Test Succeeded. End Write, rewind, and re-read test ===

btape: btape.c:1299-0 Block position test
btape: btape.c:1311-0 Rewind OK.
Reposition to file:block 0:4
Block 5 re-read correctly.
Reposition to file:block 0:200
Block 201 re-read correctly.
Reposition to file:block 0:9999
Block 10000 re-read correctly.
Reposition to file:block 1:0
Block 10001 re-read correctly.
Reposition to file:block 1:600
Block 10601 re-read correctly.
Reposition to file:block 1:9999
Block 20000 re-read correctly.
=== Test Succeeded. End Write, rewind, and re-read test ===



=== Append files test ===

This test is essential to Bareos.

I'm going to write one record  in file 0,
                   two records in file 1,
             and three records in file 2

btape: btape.c:589-0 Rewound "LTO-2" (/dev/nst0)
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:619-0 Wrote 1 EOF to "LTO-2" (/dev/nst0)
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:619-0 Wrote 1 EOF to "LTO-2" (/dev/nst0)
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:619-0 Wrote 1 EOF to "LTO-2" (/dev/nst0)
btape: btape.c:487-0 open device "LTO-2" (/dev/nst0): OK
btape: btape.c:589-0 Rewound "LTO-2" (/dev/nst0)
btape: btape.c:1443-0 Now moving to end of medium.
btape: btape.c:640-0 Moved to end of medium.
We should be in file 3. I am at file 3. This is correct!

Now the important part, I am going to attempt to append to the tape.

btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:619-0 Wrote 1 EOF to "LTO-2" (/dev/nst0)
btape: btape.c:589-0 Rewound "LTO-2" (/dev/nst0)
Done appending, there should be no I/O errors

Doing Bareos scan of blocks:
1 block of 64448 bytes in file 1
End of File mark.
2 blocks of 64448 bytes in file 2
End of File mark.
3 blocks of 64448 bytes in file 3
End of File mark.
1 block of 64448 bytes in file 4
End of File mark.
Total files=4, blocks=7, bytes = 451,136
End scanning the tape.
We should be in file 4. I am at file 4. This is correct!

The above Bareos scan should have output identical to what follows.
Please double check it ...
=== Sample correct output ===
1 block of 64448 bytes in file 1
End of File mark.
2 blocks of 64448 bytes in file 2
End of File mark.
3 blocks of 64448 bytes in file 3
End of File mark.
1 block of 64448 bytes in file 4
End of File mark.
Total files=4, blocks=7, bytes = 451,136
=== End sample correct output ===

If the above scan output is not identical to the
sample output, you MUST correct the problem
or Bareos will not be able to write multiple Jobs to 
the tape.


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

I'm going to write three records and an EOF
then backup over the EOF and re-read the last record.
Bareos does this after writing the last block on the
tape to verify that the block was written correctly.

This is not an *essential* feature ...

btape: btape.c:589-0 Rewound "LTO-2" (/dev/nst0)
btape: btape.c:825-0 Wrote first record of 64412 bytes.
btape: btape.c:836-0 Wrote second record of 64412 bytes.
btape: btape.c:847-0 Wrote third record of 64412 bytes.
btape: btape.c:619-0 Wrote 1 EOF to "LTO-2" (/dev/nst0)
btape: btape.c:863-0 Backspaced over EOF OK.
btape: btape.c:868-0 Backspace record OK.
btape: btape.c:886-0 
Block re-read correct. Test succeeded!
=== End Write, backup, and re-read test ===



=== Forward space files test ===

This test is essential to Bareos.

I'm going to write five files then test forward spacing

btape: btape.c:589-0 Rewound "LTO-2" (/dev/nst0)
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:619-0 Wrote 1 EOF to "LTO-2" (/dev/nst0)
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:619-0 Wrote 1 EOF to "LTO-2" (/dev/nst0)
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:619-0 Wrote 1 EOF to "LTO-2" (/dev/nst0)
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:619-0 Wrote 1 EOF to "LTO-2" (/dev/nst0)
btape: btape.c:1930-0 Wrote one record of 64412 bytes.
btape: btape.c:1932-0 Wrote block to device.
btape: btape.c:619-0 Wrote 1 EOF to "LTO-2" (/dev/nst0)
btape: btape.c:589-0 Rewound "LTO-2" (/dev/nst0)
btape: btape.c:1657-0 Now forward spacing 1 file.
We should be in file 1. I am at file 1. This is correct!
btape: btape.c:1669-0 Now forward spacing 2 files.
We should be in file 3. I am at file 3. This is correct!
btape: btape.c:589-0 Rewound "LTO-2" (/dev/nst0)
btape: btape.c:1682-0 Now forward spacing 4 files.
We should be in file 4. I am at file 4. This is correct!

btape: btape.c:1700-0 Now forward spacing 1 more file.
We should be in file 5. I am at file 5. This is correct!

=== End Forward space files test ===

*
############################################################
# Truncate tape
############################################################

# mt -f /dev/nst0 rewind; mt -f /dev/nst0 weof; mt -f /dev/nst0 rewind

############################################################
# Run bareos-sd in debug mode
############################################################

# bareos-sd -f -d 200
bareos-sd (90): stored_conf.c:837-0 Inserting Director res: i7-mon                                                                                                      
bareos-sd (90): stored_conf.c:837-0 Inserting Device res: FileStorage                                                                                                   
i7-sd (100): jcr.c:141-0 read_last_jobs seek to 192                                                                                                                     
i7-sd (100): jcr.c:148-0 Read num_items=10                                                                                                                              
i7-sd (8): crypto_cache.c:55-0 Could not open crypto cache file. /var/lib/bareos/bareos-sd.9103.cryptoc ERR=No such file or directory                                   
i7-sd (10): socket_server.c:112-0 stored: listening on port 9103                                                                                                        
i7-sd (100): bnet_server_tcp.c:166-0 Addresses host[ipv4;0.0.0.0;9103]                                                                                                  
i7-sd (90): stored.c:643-0 calling init_dev /dev/nst0                                                                                                                                               
i7-sd (100): sd_backends.c:112-0 init_backend_dev: testing backend /usr/lib64/bareos/backends/libbareossd-tape.so                                                                                   
i7-sd (100): dev.c:393-0 init_dev: tape=1 dev_name=/dev/nst0                                                                                                                                        
i7-sd (100): dev.c:395-0 dev=/dev/nst0 dev_max_bs=0 max_bs=0                                                                                                                                        
i7-sd (10): stored.c:645-0 SD init done /dev/nst0                                                                                                                                                   
i7-sd (100): block.c:127-0 created new block of blocksize 64512 (dev->device->label_block_size) as dev->max_block_size is zero                                                                      
i7-sd (20): stored.c:664-0 calling first_open_device "LTO-2" (/dev/nst0)                                                                                                                            
i7-sd (120): device.c:266-0 start open_output_device()                                                                                                                                              
i7-sd (129): device.c:285-0 Opening device.                                                                                                                                                         
i7-sd (100): dev.c:561-0 open dev: type=2 dev_name="LTO-2" (/dev/nst0) vol= mode=OPEN_READ_ONLY                                                                                                     
i7-sd (100): dev.c:572-0 call open_device mode=OPEN_READ_ONLY                                                                                                                                       
i7-sd (190): dev.c:1006-0 Enter mount                                                                                                                                                               
i7-sd (100): generic_tape_device.c:49-0 Open dev: device is tape                                                                                                                                    
i7-sd (100): generic_tape_device.c:60-0 Try open "LTO-2" (/dev/nst0) mode=OPEN_READ_ONLY                                                                                                            
i7-sd (100): generic_tape_device.c:88-0 Rewind after open                                                                                                                                           
i7-sd (100): generic_tape_device.c:996-0 In set_os_device_parameters                                                                                                                                
i7-sd (100): generic_tape_device.c:1002-0 Set block size to zero                                                                                                                                    
i7-sd (100): generic_tape_device.c:1018-0 MTSETDRVBUFFER                                                                                                                                            
i7-sd (100): generic_tape_device.c:144-0 open dev: tape 4 opened                                                                                                                                    
i7-sd (100): dev.c:580-0 preserve=0xb7ffedc0 fd=4                                                                                                                                                   
i7-sd (129): device.c:291-0 open dev "LTO-2" (/dev/nst0) OK                                                                                                                                         
i7-sd (100): dev.c:502-0 setting minblocksize to 64512, maxblocksize to label_block_size=64512, on device "LTO-2" (/dev/nst0)                                                                       
i7-sd (100): label.c:76-0 Enter read_volume_label res=0 device="LTO-2" (/dev/nst0) vol= dev_Vol=*NULL* max_blocksize=64512                                                                          
i7-sd (130): label.c:140-0 Big if statement in read_volume_label                                                                                                                                    
i7-sd (130): label.c:145-0 Requested Volume "" on "LTO-2" (/dev/nst0) is not a Bareos labeled Volume, because: ERR=block.c:1021 Read zero bytes at 0:0 on device "LTO-2" (/dev/nst0).               
i7-sd (100): label.c:173-0 No volume label - bailing out                                                                                                                                            
i7-sd (150): label.c:287-0 return 3                                                                                                                                                                 
i7-sd (90): stored.c:643-0 calling init_dev /storage/---backup                                                                                                                                      
i7-sd (100): dev.c:393-0 init_dev: tape=0 dev_name=/storage/---backup
i7-sd (100): dev.c:395-0 dev=/storage/---backup dev_max_bs=0 max_bs=0
i7-sd (10): stored.c:645-0 SD init done /storage/---backup
i7-sd (100): block.c:127-0 created new block of blocksize 64512 (dev->device->label_block_size) as dev->max_block_size is zero
i7-sd (200): job.c:457-0 Start stored free_jcr
i7-sd (200): job.c:584-0 End stored free_jcr

############################################################
# here I run bconsole
# then 'label storage=LTO-2 volume=BackupTape1 pool=DailyPool'
# (see bconsole output below)
############################################################

i7-sd (110): socket_server.c:79-0 Conn: Hello Director i7-dir calling
i7-sd (110): socket_server.c:97-0 Got a DIR connection at 07-Jan-2016 11:33:50
i7-sd (50): cram-md5.c:68-0 send: auth cram-md5 <1448380438.1452159230@i7-sd> ssl=0
i7-sd (100): cram-md5.c:123-0 cram-get received: auth cram-md5 <788601626.1452159230@i7-dir> ssl=0
i7-sd (99): cram-md5.c:143-0 sending resp to challenge: 94AP+9BSP8+5268QVX/hmB
i7-sd (90): dir_cmd.c:256-0 Message channel init completed.
i7-sd (199): dir_cmd.c:267-0 <dird: label LTO-2 VolumeName=BackupTape1 PoolName=DailyPool MediaType=LTO-2 Slot=0 drive=0 MinBlocksize=0 MaxBlocksize=0i7-sd (200): dir_cmd.c:285-0 Do command: label
i7-sd (20): dir_cmd.c:804-0 Found device LTO-2
i7-sd (100): dir_cmd.c:844-0 Found device LTO-2
i7-sd (100): block.c:127-0 created new block of blocksize 64512 (dev->device->label_block_size) as dev->max_block_size is zero
i7-sd (100): dev.c:432-0 Device "LTO-2" (/dev/nst0) has dev->device->max_block_size of 0 and dev->max_block_size of 0, dcr->VolMaxBlocksize is 0
i7-sd (100): dev.c:474-0 set minblocksize to 0, maxblocksize to 0 on device "LTO-2" (/dev/nst0)
i7-sd (100): dev.c:483-0 created new block of buf_len: 0 on device "LTO-2" (/dev/nst0)
i7-sd (100): block.c:127-0 created new block of blocksize 64512 (dev->device->label_block_size) as dev->max_block_size is zero
i7-sd (100): dev.c:487-0 created new block of buf_len: 64512 on device "LTO-2" (/dev/nst0), freeing block
i7-sd (100): dir_cmd.c:666-0 Stole device "LTO-2" (/dev/nst0) lock, writing label.
i7-sd (90): dir_cmd.c:668-0 try_autoload_device - looking for volume_info
i7-sd (100): autochanger.c:99-0 Device "LTO-2" (/dev/nst0) is not an autochanger
i7-sd (100): dev.c:544-0 Close fd for mode change.
i7-sd (100): dev.c:561-0 open dev: type=2 dev_name="LTO-2" (/dev/nst0) vol=BackupTape1 mode=OPEN_READ_WRITE
i7-sd (100): dev.c:572-0 call open_device mode=OPEN_READ_WRITE
i7-sd (190): dev.c:1006-0 Enter mount
i7-sd (100): generic_tape_device.c:49-0 Open dev: device is tape
i7-sd (100): generic_tape_device.c:60-0 Try open "LTO-2" (/dev/nst0) mode=OPEN_READ_WRITE
i7-sd (100): generic_tape_device.c:88-0 Rewind after open
i7-sd (100): generic_tape_device.c:996-0 In set_os_device_parameters
i7-sd (100): generic_tape_device.c:1002-0 Set block size to zero
i7-sd (100): generic_tape_device.c:1018-0 MTSETDRVBUFFER
i7-sd (100): generic_tape_device.c:144-0 open dev: tape 4 opened
i7-sd (100): dev.c:580-0 preserve=0xb7ffeb10 fd=4
i7-sd (100): dev.c:502-0 setting minblocksize to 64512, maxblocksize to label_block_size=64512, on device "LTO-2" (/dev/nst0)
i7-sd (100): label.c:76-0 Enter read_volume_label res=0 device="LTO-2" (/dev/nst0) vol=BackupTape1 dev_Vol=*NULL* max_blocksize=64512
i7-sd (130): label.c:140-0 Big if statement in read_volume_label
i7-sd (130): label.c:145-0 Requested Volume "BackupTape1" on "LTO-2" (/dev/nst0) is not a Bareos labeled Volume, because: ERR=block.c:1021 Read zero bytes at 0:0 on device "LTO-2" (/dev/nst0).
i7-sd (100): label.c:173-0 No volume label - bailing out
i7-sd (150): label.c:287-0 return 3
i7-sd (100): dev.c:502-0 setting minblocksize to 64512, maxblocksize to label_block_size=64512, on device "LTO-2" (/dev/nst0)
i7-sd (150): label.c:348-0 write_volume_label()
i7-sd (150): label.c:367-0 New VolName=BackupTape1
i7-sd (150): label.c:378-0 Label type=0
i7-sd (130): label.c:689-0 Start create_volume_label()
i7-sd (100): dev.c:921-0 Clear volhdr vol=

Volume Label:
Id                : Bareos 2.0 immortal
VerNo             : 20
VolName           : BackupTape1
PrevVolName       : 
VolFile           : 0
LabelType         : PRE_LABEL
LabelSize         : 0
PoolName          : DailyPool
MediaType         : LTO-2
PoolType          : Backup
HostName          : i7
Date label written: 07-Jan-2016 11:33
i7-sd (150): label.c:679-0 Created Vol label rec: FI=PRE_LABEL len=158
i7-sd (130): label.c:426-0 Wrote label of 158 bytes to "LTO-2" (/dev/nst0)
i7-sd (130): label.c:430-0 Call write_block_to_dev()
i7-sd (100): block.c:659-0 === Write error. fd=4 size=194 rtn=-1 dev_blk=0 blk_blk=0 errno=22: ERR=Invalid argument
i7-sd (129): generic_tape_device.c:368-0 === weof_dev="LTO-2" (/dev/nst0)
i7-sd (50): block.c:839-0 dir_update_volume_info terminate writing -- OK
i7-sd (50): block.c:867-0 *** Leave terminate_writing_volume -- OK
i7-sd (100): generic_tape_device.c:608-0 bsf
i7-sd (100): generic_tape_device.c:714-0 bsr_dev
i7-sd (130): label.c:432-0 Bad Label write on "LTO-2" (/dev/nst0): ERR=generic_tape_device.c:726 ioctl MTBSR error on "LTO-2" (/dev/nst0). ERR=Input/output error.

i7-sd (150): vol_mgr.c:705-0 vol_unused: no vol on "LTO-2" (/dev/nst0)
i7-sd (100): dev.c:921-0 Clear volhdr vol=BackupTape1
i7-sd (150): vol_mgr.c:705-0 vol_unused: no vol on "LTO-2" (/dev/nst0)
i7-sd (200): job.c:457-0 Start stored free_jcr
i7-sd (200): job.c:584-0 End stored free_jcr

############################################################
# bconsole output
############################################################

# bconsole 
Connecting to Director i7:9101
1000 OK: i7-dir Version: 15.2.2 (16 November 2015)
Enter a period to cancel a command.
*label storage=LTO-2 volume=BackupTape1 pool=DailyPool
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Connecting to Storage daemon LTO-2 at i7:9103 ...
Sending label command for Volume "BackupTape1" Slot 0 ...
block.c:630 Write error at 0:0 on device "LTO-2" (/dev/nst0). ERR=Invalid argument.
block.c:644 Write error on fd=4 at file:blk 0:0 on device "LTO-2" (/dev/nst0). ERR=Invalid argument.
Backspace record at EOT failed. ERR=Input/output error
3912 Failed to label Volume: ERR=generic_tape_device.c:726 ioctl MTBSR error on "LTO-2" (/dev/nst0). ERR=Input/output error.

Label command failed for Volume BackupTape1.                                                                                                                
Do not forget to mount the drive!!!                                                                                                                         
*                

############################################################
# Hardware and system info
############################################################

# lspci | grep -i adaptec                                                                                                                              
04:04.0 SCSI storage controller: Adaptec ASC-29320ALP U320 (rev 10)

# lsscsi | grep LTO
[8:0:3:0]    tape    IBM      HH LTO Gen 2     0468  /dev/st0 

# uname -a                                                                                                                                             
Linux i7 4.1.13-5-default #1 SMP PREEMPT Thu Nov 26 16:35:17 UTC 2015 (49475c3) x86_64 x86_64 x86_64 GNU/Linux   

# groups bareos
bareos : bareos disk tape

# ls -alF /dev/nst0
crw-rw---- 1 root tape 9, 128 Jan  7 09:21 /dev/nst0
bareos-label-failure.txt (22,014 bytes)   
avantsysadm@avant.ca

avantsysadm@avant.ca

2016-01-07 22:39

reporter   ~0002076

Try setting your tape device's maximum block size to 64412, or smaller (maybe 32768?).
The SD appears to be calculating it as 64512 whereas btape calculated 64412.
While LTO-4 and newer devices support massive block sizes, LTO-2 was typically capped at 64k. I don't know why your drive doesn't like that, but it clearly doesn't.
If my guess is correct, dmesg(8) will show an error relating to the st driver and blocksize.
See http://doc.bareos.org/master/html/bareos-manual-main-reference.html#x1-23700019.15 for additional details.

user256

2016-01-07 23:10

  ~0002077

Thanks for the suggestion. I can surely try that but let me please just ask before doing that:

1) As far as I read in the docs, changing block size would make all tapes which use the current block size unreadable. If that happens I am afraid I won't be able to restore from my archive volumes (which I currently can do). Or am I missing something?

2) Currently in dmesg I have a line:

[ 86.339750] st 8:0:3:0: [st0] Block limits 256 - 524288 bytes.

Doesn't that mean that the device supports blocks up to 524288 bytes?

3) Where does the difference of 100 bytes (64412 + 100 = 64512) come from? Isn't btape supposed to confirm that everything checks?

I hope you don't mind me asking. I am just afraid not to break anything that works.

user256

2016-01-08 14:24

 

2015-01-08-bareos.log (20,497 bytes)   
i7:~ # mt -f /dev/nst0 rewind; mt -f /dev/nst0 weof; mt -f /dev/nst0 rewind

#############################################################################
## set Maximum Block Size = 64412 in bareos-sd.conf
#############################################################################

i7:~ # bareos-sd -f -d 200                   
bareos-sd (90): stored_conf.c:837-0 Inserting Director res: i7-mon
bareos-sd (90): stored_conf.c:837-0 Inserting Device res: FileStorage
i7-sd (100): jcr.c:141-0 read_last_jobs seek to 192
i7-sd (100): jcr.c:148-0 Read num_items=10
i7-sd (8): crypto_cache.c:55-0 Could not open crypto cache file. /var/lib/bareos/bareos-sd.9103.cryptoc ERR=No such file or directory
i7-sd (10): socket_server.c:112-0 stored: listening on port 9103
i7-sd (100): bnet_server_tcp.c:166-0 Addresses host[ipv4;0.0.0.0;9103] 
i7-sd (90): stored.c:643-0 calling init_dev /dev/nst0
i7-sd (100): sd_backends.c:112-0 init_backend_dev: testing backend /usr/lib64/bareos/backends/libbareossd-tape.so
i7-sd (100): dev.c:393-0 init_dev: tape=1 dev_name=/dev/nst0
i7-sd (100): dev.c:395-0 dev=/dev/nst0 dev_max_bs=64412 max_bs=64412
i7-sd (10): stored.c:645-0 SD init done /dev/nst0
i7-sd (100): block.c:130-0 created new block of blocksize 64412 (dev->max_block_size)
i7-sd (20): stored.c:664-0 calling first_open_device "LTO-2" (/dev/nst0)
i7-sd (120): device.c:266-0 start open_output_device()
i7-sd (129): device.c:285-0 Opening device.
i7-sd (100): dev.c:561-0 open dev: type=2 dev_name="LTO-2" (/dev/nst0) vol= mode=OPEN_READ_ONLY
i7-sd (100): dev.c:572-0 call open_device mode=OPEN_READ_ONLY
i7-sd (190): dev.c:1006-0 Enter mount
i7-sd (100): generic_tape_device.c:49-0 Open dev: device is tape
i7-sd (100): generic_tape_device.c:60-0 Try open "LTO-2" (/dev/nst0) mode=OPEN_READ_ONLY
i7-sd (100): generic_tape_device.c:88-0 Rewind after open
i7-sd (100): generic_tape_device.c:996-0 In set_os_device_parameters
i7-sd (100): generic_tape_device.c:1018-0 MTSETDRVBUFFER
i7-sd (100): generic_tape_device.c:144-0 open dev: tape 4 opened
i7-sd (100): dev.c:580-0 preserve=0x268a0dc0 fd=4
i7-sd (129): device.c:291-0 open dev "LTO-2" (/dev/nst0) OK
i7-sd (100): dev.c:502-0 setting minblocksize to 64512, maxblocksize to label_block_size=64512, on device "LTO-2" (/dev/nst0)
i7-sd (100): block.c:130-0 created new block of blocksize 64512 (dev->max_block_size)
i7-sd (100): dev.c:515-0 created new block of buf_len: 64512 on device "LTO-2" (/dev/nst0)
i7-sd (100): label.c:76-0 Enter read_volume_label res=0 device="LTO-2" (/dev/nst0) vol= dev_Vol=*NULL* max_blocksize=64512
i7-sd (130): label.c:140-0 Big if statement in read_volume_label
i7-sd (130): label.c:145-0 Requested Volume "" on "LTO-2" (/dev/nst0) is not a Bareos labeled Volume, because: ERR=block.c:1021 Read zero bytes at 0:0 on device "LTO-2" (/dev/nst0).
i7-sd (100): label.c:173-0 No volume label - bailing out
i7-sd (150): label.c:287-0 return 3
i7-sd (90): stored.c:643-0 calling init_dev /storage/---backup
i7-sd (100): dev.c:393-0 init_dev: tape=0 dev_name=/storage/---backup
i7-sd (100): dev.c:395-0 dev=/storage/---backup dev_max_bs=0 max_bs=0
i7-sd (10): stored.c:645-0 SD init done /storage/---backup
i7-sd (100): block.c:127-0 created new block of blocksize 64512 (dev->device->label_block_size) as dev->max_block_size is zero
i7-sd (200): job.c:457-0 Start stored free_jcr
i7-sd (200): job.c:584-0 End stored free_jcr



#############################################################################
## (run bconsole and label) Result pasted here
#############################################################################

i7:~ # bconsole 
Connecting to Director i7:9101
1000 OK: i7-dir Version: 15.2.2 (16 November 2015)
Enter a period to cancel a command.
*label storage=LTO-2 volume=BackupTape1 pool=DailyPool                       
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Connecting to Storage daemon LTO-2 at i7:9103 ...
Sending label command for Volume "BackupTape1" Slot 0 ...
dev.c:466 Max block size 64412 not multiple of device "LTO-2" (/dev/nst0) block size=1024.
block.c:630 Write error at 0:0 on device "LTO-2" (/dev/nst0). ERR=Invalid argument.
block.c:644 Write error on fd=4 at file:blk 0:0 on device "LTO-2" (/dev/nst0). ERR=Invalid argument.
Backspace record at EOT failed. ERR=Input/output error
3912 Failed to label Volume: ERR=generic_tape_device.c:726 ioctl MTBSR error on "LTO-2" (/dev/nst0). ERR=Input/output error.

Label command failed for Volume BackupTape1.
Do not forget to mount the drive!!!
*

#############################################################################
## (end of bconsole paste)
#############################################################################




#############################################################################
## journalctl output happening at the same time:
#############################################################################

Jan 08 15:05:18 i7 kernel: st 8:0:3:0: [st0] Write not multiple of tape block size.

#############################################################################
## (end of journalctl output), continuing with the output of bareos-sd:
#############################################################################


i7-sd (110): socket_server.c:79-0 Conn: Hello Director i7-dir calling
i7-sd (110): socket_server.c:97-0 Got a DIR connection at 08-Jan-2016 15:05:10
i7-sd (50): cram-md5.c:68-0 send: auth cram-md5 <780510422.1452258310@i7-sd> ssl=0
i7-sd (100): cram-md5.c:123-0 cram-get received: auth cram-md5 <1934464832.1452258310@i7-dir> ssl=0
i7-sd (99): cram-md5.c:143-0 sending resp to challenge: O7YTURQCI8+5SlBwe6gD8C
i7-sd (90): dir_cmd.c:256-0 Message channel init completed.
i7-sd (199): dir_cmd.c:267-0 <dird: label LTO-2 VolumeName=BackupTape1 PoolName=DailyPool MediaType=LTO-2 Slot=0 drive=0 MinBlocksize=0 MaxBlocksize=0i7-sd (200): dir_cmd.c:285-0 Do command: label
i7-sd (20): dir_cmd.c:804-0 Found device LTO-2
i7-sd (100): dir_cmd.c:844-0 Found device LTO-2
i7-sd (100): block.c:127-0 created new block of blocksize 64512 (dev->device->label_block_size) as dev->max_block_size is zero
i7-sd (100): dev.c:432-0 Device "LTO-2" (/dev/nst0) has dev->device->max_block_size of 64412 and dev->max_block_size of 0, dcr->VolMaxBlocksize is 0
i7-sd (100): dev.c:437-0 setting dev->max_block_size to dev->device->max_block_size=64412 on device "LTO-2" (/dev/nst0) because dcr->VolMaxBlocksize is 0
i7-sd (100): dev.c:474-0 set minblocksize to 0, maxblocksize to 64412 on device "LTO-2" (/dev/nst0)
i7-sd (100): dev.c:483-0 created new block of buf_len: 64412 on device "LTO-2" (/dev/nst0)
i7-sd (100): block.c:130-0 created new block of blocksize 64412 (dev->max_block_size)
i7-sd (100): dev.c:487-0 created new block of buf_len: 64412 on device "LTO-2" (/dev/nst0), freeing block
i7-sd (100): dir_cmd.c:666-0 Stole device "LTO-2" (/dev/nst0) lock, writing label.
i7-sd (90): dir_cmd.c:668-0 try_autoload_device - looking for volume_info
i7-sd (100): autochanger.c:99-0 Device "LTO-2" (/dev/nst0) is not an autochanger
i7-sd (100): dev.c:544-0 Close fd for mode change.
i7-sd (100): dev.c:561-0 open dev: type=2 dev_name="LTO-2" (/dev/nst0) vol=BackupTape1 mode=OPEN_READ_WRITE
i7-sd (100): dev.c:572-0 call open_device mode=OPEN_READ_WRITE
i7-sd (190): dev.c:1006-0 Enter mount
i7-sd (100): generic_tape_device.c:49-0 Open dev: device is tape
i7-sd (100): generic_tape_device.c:60-0 Try open "LTO-2" (/dev/nst0) mode=OPEN_READ_WRITE
i7-sd (100): generic_tape_device.c:88-0 Rewind after open
i7-sd (100): generic_tape_device.c:996-0 In set_os_device_parameters
i7-sd (100): generic_tape_device.c:1018-0 MTSETDRVBUFFER
i7-sd (100): generic_tape_device.c:144-0 open dev: tape 4 opened
i7-sd (100): dev.c:580-0 preserve=0x268a0b10 fd=4
i7-sd (100): dev.c:502-0 setting minblocksize to 64512, maxblocksize to label_block_size=64512, on device "LTO-2" (/dev/nst0)
i7-sd (100): block.c:130-0 created new block of blocksize 64512 (dev->max_block_size)
i7-sd (100): dev.c:515-0 created new block of buf_len: 64512 on device "LTO-2" (/dev/nst0)
i7-sd (100): label.c:76-0 Enter read_volume_label res=0 device="LTO-2" (/dev/nst0) vol=BackupTape1 dev_Vol=*NULL* max_blocksize=64512
i7-sd (130): label.c:140-0 Big if statement in read_volume_label
i7-sd (130): label.c:145-0 Requested Volume "BackupTape1" on "LTO-2" (/dev/nst0) is not a Bareos labeled Volume, because: ERR=block.c:1021 Read zero bytes at 0:0 on device "LTO-2" (/dev/nst0).
i7-sd (100): label.c:173-0 No volume label - bailing out
i7-sd (150): label.c:287-0 return 3
i7-sd (100): dev.c:502-0 setting minblocksize to 64512, maxblocksize to label_block_size=64512, on device "LTO-2" (/dev/nst0)
i7-sd (150): label.c:348-0 write_volume_label()
i7-sd (150): label.c:367-0 New VolName=BackupTape1
i7-sd (150): label.c:378-0 Label type=0
i7-sd (130): label.c:689-0 Start create_volume_label()
i7-sd (100): dev.c:921-0 Clear volhdr vol=

Volume Label:
Id                : Bareos 2.0 immortal
VerNo             : 20
VolName           : BackupTape1
PrevVolName       : 
VolFile           : 0
LabelType         : PRE_LABEL
LabelSize         : 0
PoolName          : DailyPool
MediaType         : LTO-2
PoolType          : Backup
HostName          : i7
Date label written: 08-Jan-2016 15:05
i7-sd (150): label.c:679-0 Created Vol label rec: FI=PRE_LABEL len=158
i7-sd (130): label.c:426-0 Wrote label of 158 bytes to "LTO-2" (/dev/nst0)
i7-sd (130): label.c:430-0 Call write_block_to_dev()
i7-sd (100): block.c:659-0 === Write error. fd=4 size=194 rtn=-1 dev_blk=0 blk_blk=0 errno=22: ERR=Invalid argument
i7-sd (129): generic_tape_device.c:368-0 === weof_dev="LTO-2" (/dev/nst0)
i7-sd (50): block.c:839-0 dir_update_volume_info terminate writing -- OK
i7-sd (50): block.c:867-0 *** Leave terminate_writing_volume -- OK
i7-sd (100): generic_tape_device.c:608-0 bsf
i7-sd (100): generic_tape_device.c:714-0 bsr_dev
i7-sd (130): label.c:432-0 Bad Label write on "LTO-2" (/dev/nst0): ERR=generic_tape_device.c:726 ioctl MTBSR error on "LTO-2" (/dev/nst0). ERR=Input/output error.

i7-sd (150): vol_mgr.c:705-0 vol_unused: no vol on "LTO-2" (/dev/nst0)
i7-sd (100): dev.c:921-0 Clear volhdr vol=BackupTape1
i7-sd (150): vol_mgr.c:705-0 vol_unused: no vol on "LTO-2" (/dev/nst0)
i7-sd (200): job.c:457-0 Start stored free_jcr
i7-sd (200): job.c:584-0 End stored free_jcr

^C


#############################################################################
## set Maximum Block Size = 32768 in bareos-sd.conf
#############################################################################


i7:~ # bareos-sd -f -d 200
bareos-sd (90): stored_conf.c:837-0 Inserting Director res: i7-mon
bareos-sd (90): stored_conf.c:837-0 Inserting Device res: FileStorage
i7-sd (100): jcr.c:141-0 read_last_jobs seek to 192
i7-sd (100): jcr.c:148-0 Read num_items=10
i7-sd (8): crypto_cache.c:55-0 Could not open crypto cache file. /var/lib/bareos/bareos-sd.9103.cryptoc ERR=No such file or directory
i7-sd (10): socket_server.c:112-0 stored: listening on port 9103
i7-sd (100): bnet_server_tcp.c:166-0 Addresses host[ipv4;0.0.0.0;9103] 
i7-sd (90): stored.c:643-0 calling init_dev /dev/nst0
i7-sd (100): sd_backends.c:112-0 init_backend_dev: testing backend /usr/lib64/bareos/backends/libbareossd-tape.so
i7-sd (100): dev.c:393-0 init_dev: tape=1 dev_name=/dev/nst0
i7-sd (100): dev.c:395-0 dev=/dev/nst0 dev_max_bs=32768 max_bs=32768
i7-sd (10): stored.c:645-0 SD init done /dev/nst0
i7-sd (100): block.c:130-0 created new block of blocksize 32768 (dev->max_block_size)
i7-sd (20): stored.c:664-0 calling first_open_device "LTO-2" (/dev/nst0)
i7-sd (120): device.c:266-0 start open_output_device()
i7-sd (129): device.c:285-0 Opening device.
i7-sd (100): dev.c:561-0 open dev: type=2 dev_name="LTO-2" (/dev/nst0) vol= mode=OPEN_READ_ONLY
i7-sd (100): dev.c:572-0 call open_device mode=OPEN_READ_ONLY
i7-sd (190): dev.c:1006-0 Enter mount
i7-sd (100): generic_tape_device.c:49-0 Open dev: device is tape
i7-sd (100): generic_tape_device.c:60-0 Try open "LTO-2" (/dev/nst0) mode=OPEN_READ_ONLY
i7-sd (100): generic_tape_device.c:88-0 Rewind after open
i7-sd (100): generic_tape_device.c:996-0 In set_os_device_parameters
i7-sd (100): generic_tape_device.c:1018-0 MTSETDRVBUFFER
i7-sd (100): generic_tape_device.c:144-0 open dev: tape 4 opened
i7-sd (100): dev.c:580-0 preserve=0x88ceedc0 fd=4
i7-sd (129): device.c:291-0 open dev "LTO-2" (/dev/nst0) OK
i7-sd (100): dev.c:502-0 setting minblocksize to 64512, maxblocksize to label_block_size=64512, on device "LTO-2" (/dev/nst0)
i7-sd (100): block.c:130-0 created new block of blocksize 64512 (dev->max_block_size)
i7-sd (100): dev.c:515-0 created new block of buf_len: 64512 on device "LTO-2" (/dev/nst0)
i7-sd (100): label.c:76-0 Enter read_volume_label res=0 device="LTO-2" (/dev/nst0) vol= dev_Vol=*NULL* max_blocksize=64512
i7-sd (130): label.c:140-0 Big if statement in read_volume_label
i7-sd (130): label.c:145-0 Requested Volume "" on "LTO-2" (/dev/nst0) is not a Bareos labeled Volume, because: ERR=block.c:1021 Read zero bytes at 0:0 on device "LTO-2" (/dev/nst0).
i7-sd (100): label.c:173-0 No volume label - bailing out
i7-sd (150): label.c:287-0 return 3
i7-sd (90): stored.c:643-0 calling init_dev /storage/---backup
i7-sd (100): dev.c:393-0 init_dev: tape=0 dev_name=/storage/---backup
i7-sd (100): dev.c:395-0 dev=/storage/---backup dev_max_bs=0 max_bs=0
i7-sd (10): stored.c:645-0 SD init done /storage/---backup
i7-sd (100): block.c:127-0 created new block of blocksize 64512 (dev->device->label_block_size) as dev->max_block_size is zero
i7-sd (200): job.c:457-0 Start stored free_jcr
i7-sd (200): job.c:584-0 End stored free_jcr


#############################################################################
## (run bconsole and label) Result pasted here
#############################################################################

i7:~ # bconsole 
Connecting to Director i7:9101
1000 OK: i7-dir Version: 15.2.2 (16 November 2015)
Enter a period to cancel a command.
*label storage=LTO-2 volume=BackupTape1 pool=DailyPool
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Connecting to Storage daemon LTO-2 at i7:9103 ...
Sending label command for Volume "BackupTape1" Slot 0 ...
block.c:630 Write error at 0:0 on device "LTO-2" (/dev/nst0). ERR=Invalid argument.
block.c:644 Write error on fd=4 at file:blk 0:0 on device "LTO-2" (/dev/nst0). ERR=Invalid argument.
Backspace record at EOT failed. ERR=Input/output error
3912 Failed to label Volume: ERR=generic_tape_device.c:726 ioctl MTBSR error on "LTO-2" (/dev/nst0). ERR=Input/output error.

Label command failed for Volume BackupTape1.
Do not forget to mount the drive!!!
*

#############################################################################
## (end of bconsole paste)
#############################################################################




#############################################################################
## journalctl output happening at the same time:
#############################################################################

Jan 08 15:07:37 i7 kernel: st 8:0:3:0: [st0] Write not multiple of tape block size.

#############################################################################
## (end of journalctl output), continuing with the output of bareos-sd:
#############################################################################


i7-sd (110): socket_server.c:79-0 Conn: Hello Director i7-dir calling
i7-sd (110): socket_server.c:97-0 Got a DIR connection at 08-Jan-2016 15:07:29
i7-sd (50): cram-md5.c:68-0 send: auth cram-md5 <705195071.1452258449@i7-sd> ssl=0
i7-sd (100): cram-md5.c:123-0 cram-get received: auth cram-md5 <1146755885.1452258449@i7-dir> ssl=0
i7-sd (99): cram-md5.c:143-0 sending resp to challenge: w9+rqm+m55MdG8cymD/b3A
i7-sd (90): dir_cmd.c:256-0 Message channel init completed.
i7-sd (199): dir_cmd.c:267-0 <dird: label LTO-2 VolumeName=BackupTape1 PoolName=DailyPool MediaType=LTO-2 Slot=0 drive=0 MinBlocksize=0 MaxBlocksize=0i7-sd (200): dir_cmd.c:285-0 Do command: label
i7-sd (20): dir_cmd.c:804-0 Found device LTO-2
i7-sd (100): dir_cmd.c:844-0 Found device LTO-2
i7-sd (100): block.c:127-0 created new block of blocksize 64512 (dev->device->label_block_size) as dev->max_block_size is zero
i7-sd (100): dev.c:432-0 Device "LTO-2" (/dev/nst0) has dev->device->max_block_size of 32768 and dev->max_block_size of 0, dcr->VolMaxBlocksize is 0
i7-sd (100): dev.c:437-0 setting dev->max_block_size to dev->device->max_block_size=32768 on device "LTO-2" (/dev/nst0) because dcr->VolMaxBlocksize is 0
i7-sd (100): dev.c:474-0 set minblocksize to 0, maxblocksize to 32768 on device "LTO-2" (/dev/nst0)
i7-sd (100): dev.c:483-0 created new block of buf_len: 32768 on device "LTO-2" (/dev/nst0)
i7-sd (100): block.c:130-0 created new block of blocksize 32768 (dev->max_block_size)
i7-sd (100): dev.c:487-0 created new block of buf_len: 32768 on device "LTO-2" (/dev/nst0), freeing block
i7-sd (100): dir_cmd.c:666-0 Stole device "LTO-2" (/dev/nst0) lock, writing label.
i7-sd (90): dir_cmd.c:668-0 try_autoload_device - looking for volume_info
i7-sd (100): autochanger.c:99-0 Device "LTO-2" (/dev/nst0) is not an autochanger
i7-sd (100): dev.c:544-0 Close fd for mode change.
i7-sd (100): dev.c:561-0 open dev: type=2 dev_name="LTO-2" (/dev/nst0) vol=BackupTape1 mode=OPEN_READ_WRITE
i7-sd (100): dev.c:572-0 call open_device mode=OPEN_READ_WRITE
i7-sd (190): dev.c:1006-0 Enter mount
i7-sd (100): generic_tape_device.c:49-0 Open dev: device is tape
i7-sd (100): generic_tape_device.c:60-0 Try open "LTO-2" (/dev/nst0) mode=OPEN_READ_WRITE
i7-sd (100): generic_tape_device.c:88-0 Rewind after open
i7-sd (100): generic_tape_device.c:996-0 In set_os_device_parameters
i7-sd (100): generic_tape_device.c:1018-0 MTSETDRVBUFFER
i7-sd (100): generic_tape_device.c:144-0 open dev: tape 4 opened
i7-sd (100): dev.c:580-0 preserve=0x88ceeb10 fd=4
i7-sd (100): dev.c:502-0 setting minblocksize to 64512, maxblocksize to label_block_size=64512, on device "LTO-2" (/dev/nst0)
i7-sd (100): block.c:130-0 created new block of blocksize 64512 (dev->max_block_size)
i7-sd (100): dev.c:515-0 created new block of buf_len: 64512 on device "LTO-2" (/dev/nst0)
i7-sd (100): label.c:76-0 Enter read_volume_label res=0 device="LTO-2" (/dev/nst0) vol=BackupTape1 dev_Vol=*NULL* max_blocksize=64512
i7-sd (130): label.c:140-0 Big if statement in read_volume_label
i7-sd (130): label.c:145-0 Requested Volume "BackupTape1" on "LTO-2" (/dev/nst0) is not a Bareos labeled Volume, because: ERR=block.c:1021 Read zero bytes at 0:0 on device "LTO-2" (/dev/nst0).
i7-sd (100): label.c:173-0 No volume label - bailing out
i7-sd (150): label.c:287-0 return 3
i7-sd (100): dev.c:502-0 setting minblocksize to 64512, maxblocksize to label_block_size=64512, on device "LTO-2" (/dev/nst0)
i7-sd (150): label.c:348-0 write_volume_label()
i7-sd (150): label.c:367-0 New VolName=BackupTape1
i7-sd (150): label.c:378-0 Label type=0
i7-sd (130): label.c:689-0 Start create_volume_label()
i7-sd (100): dev.c:921-0 Clear volhdr vol=

Volume Label:
Id                : Bareos 2.0 immortal
VerNo             : 20
VolName           : BackupTape1
PrevVolName       : 
VolFile           : 0
LabelType         : PRE_LABEL
LabelSize         : 0
PoolName          : DailyPool
MediaType         : LTO-2
PoolType          : Backup
HostName          : i7
Date label written: 08-Jan-2016 15:07
i7-sd (150): label.c:679-0 Created Vol label rec: FI=PRE_LABEL len=158
i7-sd (130): label.c:426-0 Wrote label of 158 bytes to "LTO-2" (/dev/nst0)
i7-sd (130): label.c:430-0 Call write_block_to_dev()
i7-sd (100): block.c:659-0 === Write error. fd=4 size=194 rtn=-1 dev_blk=0 blk_blk=0 errno=22: ERR=Invalid argument
i7-sd (129): generic_tape_device.c:368-0 === weof_dev="LTO-2" (/dev/nst0)
i7-sd (50): block.c:839-0 dir_update_volume_info terminate writing -- OK
i7-sd (50): block.c:867-0 *** Leave terminate_writing_volume -- OK
i7-sd (100): generic_tape_device.c:608-0 bsf
i7-sd (100): generic_tape_device.c:714-0 bsr_dev
i7-sd (130): label.c:432-0 Bad Label write on "LTO-2" (/dev/nst0): ERR=generic_tape_device.c:726 ioctl MTBSR error on "LTO-2" (/dev/nst0). ERR=Input/output error.

i7-sd (150): vol_mgr.c:705-0 vol_unused: no vol on "LTO-2" (/dev/nst0)
i7-sd (100): dev.c:921-0 Clear volhdr vol=BackupTape1
i7-sd (150): vol_mgr.c:705-0 vol_unused: no vol on "LTO-2" (/dev/nst0)
i7-sd (200): job.c:457-0 Start stored free_jcr
i7-sd (200): job.c:584-0 End stored free_jcr
^C
i7:~ # 
2015-01-08-bareos.log (20,497 bytes)   

user256

2016-01-08 14:25

  ~0002078

Ok, I tried what you suggest.

1) with block size 64412 bconsole complains:

dev.c:466 Max block size 64412 not multiple of device "LTO-2" (/dev/nst0) block size=1024.

2) with 32768 labeling still doesn't work

In both cases in journalctl I get:

Jan 08 15:05:18 i7 kernel: st 8:0:3:0: [st0] Write not multiple of tape block size.



I am attaching the full log: 2015-01-08-bareos.log
avantsysadm@avant.ca

avantsysadm@avant.ca

2016-01-08 19:07

reporter   ~0002079

I think you'll have to wait for someone from the Bareos team to look at it, then - I was merely interested in your problem and thought I saw a clue.

Yes, the message from the st driver indicates what block size the drive *should* support. It might be worth trying an "mt -f /dev/nst0 erase", although that will probably take a couple of hours to run.

You're almost certainly running into a bug of some sort, but I can't say whether it's in the tape drive firmware, the linux kernel, the st driver, Bacula or Bareos. (And no, the fact that Bacula works does not prove that the bug is in Bareos - "bug-compatible" is a thing.)

Good luck!
Carsten

Carsten

2016-01-09 10:53

reporter   ~0002080

I can confirm the bug. I have exactly the same problem.

System: Debian 7.9
Tape Drive: HP LTO5

I was running Bareos 14.2.2 for over a year without any problem.
Yesterday I updated to 15.2.2. No backup possible after the update.
Using command "label" in "bconsole" or "btape" puts out these lines:

"block.c:286 Volume data error at 0:0! Wanted ID: "BB02", got "". Buffer discarded.
block.c:630 Write error at 0:0 on device "[servername]-Tape" (/dev/st0). ERR=Input/output error.
block.c:644 Write error on fd=5 at file:blk 0:0 on device "[servername]-Tape" (/dev/st0). ERR=Input/output error.
Backspace record at EOT failed. ERR=Input/output error
3912 Failed to label Volume: ERR=generic_tape_device.c:726 ioctl MTBSR error on "[servername]-Tape" (/dev/st0). ERR=Input/output error.

Label command failed for Volume Thursday.
Do not forget to mount the drive!!!"


With pain I downgraded back to 14.2.2 and eyerthing is fine.

@george
If you have the possibility to install 14.2.x, I guess everything will work.

user256

2016-01-09 10:56

  ~0002081

Thanks @Carsten. I actually compiled Bacula 7.2.0 yesterday. I will stick with it until this is fixed. Hopefully after that I will move to Bareos.
bruno-at-bareos

bruno-at-bareos

2023-05-10 13:17

manager   ~0005038

bareos-sd 15.2.2 got a trouble with the group affectation, which remove the bareos user from the tape group. maybe that was simple as that.
bruno-at-bareos

bruno-at-bareos

2023-05-10 13:18

manager   ~0005039

Is any of those label trouble still happen with bareos 22x series?
bruno-at-bareos

bruno-at-bareos

2023-05-15 10:31

manager   ~0005050

no answer

Issue History

Date Modified Username Field Change
2016-01-07 11:10 user256 New Issue
2016-01-07 11:10 user256 File Added: bareos-label-failure.txt
2016-01-07 22:39 avantsysadm@avant.ca Note Added: 0002076
2016-01-07 23:10 user256 Note Added: 0002077
2016-01-08 14:24 user256 File Added: 2015-01-08-bareos.log
2016-01-08 14:25 user256 Note Added: 0002078
2016-01-08 19:07 avantsysadm@avant.ca Note Added: 0002079
2016-01-09 10:53 Carsten Note Added: 0002080
2016-01-09 10:56 user256 Note Added: 0002081
2016-01-11 14:45 pstorz Status new => acknowledged
2023-05-10 13:17 bruno-at-bareos Note Added: 0005038
2023-05-10 13:18 bruno-at-bareos Assigned To => bruno-at-bareos
2023-05-10 13:18 bruno-at-bareos Status acknowledged => feedback
2023-05-10 13:18 bruno-at-bareos Note Added: 0005039
2023-05-15 10:31 bruno-at-bareos Status feedback => closed
2023-05-15 10:31 bruno-at-bareos Resolution open => no change required
2023-05-15 10:31 bruno-at-bareos Note Added: 0005050