Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tape recycling looses capacity #22

Open
digidax opened this issue Apr 23, 2021 · 1 comment
Open

tape recycling looses capacity #22

digidax opened this issue Apr 23, 2021 · 1 comment

Comments

@digidax
Copy link

digidax commented Apr 23, 2021

in reference to: https://bugs.bareos.org/view.php?id=1341

I'm trying to find out, if the mt - command procedure is the problem or the backup software (bareos a bacula fork) it self.
After doing the mt commands and starting a backup, a "medium volume full" occurs by using of only around 650 GB from the 6 TB of a LTO-7 tape:

Mount the tape into drive an then:

[root@bareos ~]# mt -f /dev/st0 rewind
[root@bareos ~]# mt -f /dev/st0 weof
[root@bareos ~]# mt -f /dev/st0 rewind
[root@bareos ~]# mt -f /dev/st0 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 (41010000):
BOT ONLINE IM_REP_EN

In bconsole, labeling and add to the pool:

Sending label command for Volume "Audio-001" Slot 0 ...
3000 OK label. VolBytes=64512 Volume="Audio-001" Device="LTO7-Tape-Drive" (/dev/nst0)
Catalog record for Volume "Audio-001", Slot 0 successfully created.
Requesting to mount LTO7-Tape-Drive ...
3001 Mounted Volume: Audio-001
3001 Device "LTO7-Tape-Drive" (/dev/nst0) is already mounted with Volume "Audio-001"

check the tape:

bls -V Audio-001 /dev/nst0

bls: stored/butil.cc:291-0 Using device: "/dev/nst0" for reading.
22-Apr 08:53 bls JobId 0: Ready to read from volume "Audio-001" on device "LTO7-Tape-Drive" (/dev/nst0).
22-Apr 08:53 bls JobId 0: End of Volume at file 1 on device "LTO7-Tape-Drive" (/dev/nst0), Volume "Audio-001"
22-Apr 08:53 bls JobId 0: End of all volumes.
0 files and directories found.
22-Apr 08:53 bls JobId 0: Releasing device "LTO7-Tape-Drive" (/dev/nst0).

btape /dev/nst0

*cap
Configured device capabilities:
EOF BSR BSF FSR FSF FASTFSF !BSFATEOM EOM REM !RACCESS AUTOMOUNT !LABEL !ANONVOLS !ALWAYSOPEN MTIOCGET
Device status:
OPENED TAPE !LABEL !MALLOC APPEND !READ !EOT !WEOT !EOF !NEXTVOL !SHORT
Device parameters:
Device name: /dev/nst0
File=0 block=0
Min block=0 Max block=524288
Status:
Bareos status: file=0 block=0
Device status: BOT ONLINE IM_REP_EN file=0 block=0
Device status: TAPE BOT ONLINE IMMREPORT. ERR=

*eod
btape: stored/btape.cc:620-0 Moved to end of medium.

*cap
Configured device capabilities:
EOF BSR BSF FSR FSF FASTFSF !BSFATEOM EOM REM !RACCESS AUTOMOUNT !LABEL !ANONVOLS !ALWAYSOPEN MTIOCGET
Device status:
OPENED TAPE !LABEL !MALLOC APPEND !READ !EOT !WEOT EOF !NEXTVOL !SHORT
Device parameters:
Device name: /dev/nst0
File=1 block=0
Min block=0 Max block=524288
Status:
EOF Bareos status: file=1 block=0
Device status: EOD ONLINE IM_REP_EN file=1 block=-1
Device status: TAPE EOF EOD ONLINE IMMREPORT. ERR=

*readlabel
btape: stored/btape.cc:528-0 Volume label read correctly.

Volume Label:
Id : Bareos 2.0 immortal
VerNo : 20
VolName : Audio-001
PrevVolName :
VolFile : 0
LabelType : PRE_LABEL
LabelSize : 183
PoolName : AudioBackup
MediaType : LTO-7
PoolType : Backup
HostName : bareos.123.com
Date label written: 22-Apr-2021 08:50

Starting a 629 GB backup job:

22-Apr 14:05 bareos-dir JobId 246: Start Backup JobId 246, Job=BackupAudio.2021-04-22_14.05.44_15
22-Apr 14:05 bareos-dir JobId 246: Connected Storage daemon at 192.168.130.211:9103, encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
22-Apr 14:05 bareos-dir JobId 246: Using Device "LTO7-Tape-Drive" to write.
22-Apr 14:05 bareos-dir JobId 246: Probing client protocol... (result will be saved until config reload)
22-Apr 14:05 bareos-dir JobId 246: Connected Client: bareos-fd at localhost:9102, encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
22-Apr 14:05 bareos-dir JobId 246: Handshake: Immediate TLS 22-Apr 14:05 bareos-dir JobId 246: Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
22-Apr 14:05 localhost-fd JobId 246: Connected Storage daemon at 192.168.130.211:9103, encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
22-Apr 14:05 localhost-fd JobId 246: Extended attribute support is enabled
22-Apr 14:05 localhost-fd JobId 246: ACL support is enabled
22-Apr 14:05 bareos-sd JobId 246: Wrote label to prelabeled Volume "Audio-001" on device "LTO7-Tape-Drive" (/dev/nst0)
22-Apr 14:05 bareos-sd JobId 246: Spooling data ...
22-Apr 15:36 bareos-sd JobId 246: Committing spooled data to Volume "Audio-001". Despooling 629,102,376,675 bytes ...
22-Apr 17:01 bareos-sd JobId 246: Error: stored/block.cc:803 Write error at 29:11710 on device "LTO7-Tape-Drive" (/dev/nst0). ERR=Input/output error.
22-Apr 17:01 bareos-sd JobId 246: Error: stored/block.cc:822 Write error on fd=6 at file:blk 29:11710 on device "LTO7-Tape-Drive" (/dev/nst0). ERR=Input/output error.
22-Apr 17:01 bareos-sd JobId 246: Error: Error writing final EOF to tape. This Volume may not be readable.
backends/generic_tape_device.cc:403 ioctl MTWEOF error on "LTO7-Tape-Drive" (/dev/nst0). ERR=Input/output error.
22-Apr 17:01 bareos-sd JobId 246: End of medium on Volume "Audio-001" Bytes=586,124,688,384 Blocks=1,117,944 at 22-Apr-2021 17:01.
22-Apr 17:01 bareos-sd JobId 246: Job BackupAudio.2021-04-22_14.05.44_15 is waiting. Cannot find any appendable volumes.

@exuvo
Copy link

exuvo commented Feb 3, 2022

The only case i have seen with that little data written was due to not using sensible block sizes when writing the data.
Example chaining tar to mbuffers but not giving mbuffers a block size to use nor --tapeaware: https://www.reddit.com/r/homelab/comments/d9g0j1/lto5_capacity_problem/ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants