View Issue Details

IDProjectCategoryView StatusLast Update
0000351bareos-coreGeneralpublic2015-03-25 19:19
Reporterelonen Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Summary0000351: Detect and refuse to write Label on LTFS formatted tapes
DescriptionI'm administrating a LTO6 autoloader system where some tapes are used for manual backup/archival using LTFS, while some are for Bareos volumes. While Bareos refuses to write a new label on a tape that is already labeled, it quite happily overwrites an LTFS formatted tape (which I've managed to do once already).

It seems to be pretty easy to detect. Here's an example of dd if=/dev/st0 from one of our tapes:
"VOL1ATM135L LTFS 4" (without quotes, of course)
Apparently the first (ansi label) partition on an LTFS formatted tape is always 80 bytes long.
TagsNo tags attached.

Activities

mvwieringen

mvwieringen

2014-10-19 16:10

developer   ~0001012

As there is already support for ANSI labels are you sure that
setting Check Labels = yes in the device section(s) of the storage daemon
is not sufficient. It seems LTFS uses a ANSI label followed by a FileMarker
and then some XML data and the again a FileMarker.

From the documentation:

This directive is implemented in the the SD Device resource. If you intend to read ANSI or IBM labels, this *must* be set. Even if the volume is not ANSI labeled, you can set this to yes, and Bareos will check the label type. Without this directive set to yes, Bareos will assume that labels are of Bacula type and will not check for ANSI or IBM labels. In other words, if there is a possibility of Bareos encountering an ANSI/IBM label, you must set this to yes.
elonen

elonen

2014-10-19 18:24

reporter   ~0001017

Yes, that worked - tested it just now. Thank you.

Is there any reason not to enable the option by default? It would seem like a safe (and not super-inconvenient) factory setting.
mvwieringen

mvwieringen

2014-10-19 19:39

developer   ~0001018

The original author of this function thought it made sense to not enable
it by default. When I look at what the code does I can imagine that the default
of off makes sense as almost no one mix and matches volume types in a library
and the ANSI reading code read up to 5 headers.

Read a maximum of 5 records VOL1, HDR1, ... HDR4

As most people don't use tapes at all making it default makes little sense
as it gives overhead for the common user which is not really interested in
this option.
elonen

elonen

2014-10-19 20:58

reporter   ~0001021

Ah, I see. How long do you think the overhead might become at worst? If it's no more that a second or two, IMHO, the extra safeguard against destroying a tape by accident would be worth it for the label command (which is used infrequently). Probably even for those who don't need mixed media in a autoloader, but might just manually pop in a wrong tape by mistake.

Anyway, the feature request is spurious as the feature is already in there as an option. Thank you for you help, and feel free to close this.
joergs

joergs

2014-10-30 20:29

developer   ~0001026

I tried to clarify this in the documentation: https://github.com/bareos/bareos-docs/commit/6550bdd451a054897c2a75783615d7ca11fea28f

I'm not sure what impact a changed default will have. I think, most people will not operate with mixed tapes.

What could be done without negative impact is to add a comment in the tape default config:
https://github.com/bareos/bareos/blob/master/src/defaultconfigs/bareos-sd.d/device-tape-with-autoloader.conf

like

# enable "Check Label" if tapes with ANSI/IBM labels
# should be preserved
#Check Label = yes
joergs

joergs

2014-12-05 22:38

developer   ~0001100

Fix committed to bareos master branch with changesetid 2434.
mvwieringen

mvwieringen

2014-12-12 02:02

developer   ~0001105

Fix committed to bareos bareos-14.2 branch with changesetid 2480.
mvwieringen

mvwieringen

2015-03-25 16:51

developer   ~0001453

Fix committed to bareos2015 bareos-14.2 branch with changesetid 4514.
joergs

joergs

2015-03-25 19:19

developer   ~0001603

Due to the reimport of the Github repository to bugs.bareos.org, the status of some tickets have been changed. These tickets will be closed again.
Sorry for the noise.

Related Changesets

bareos: master 6448016e

2014-12-04 14:37

joergs

Ported: N/A

Details Diff
added hint how to preserve foreign tapes

Fixes 0000351: Detect and refuse to write Label on LTFS formatted tapes
Affected Issues
0000351
mod - src/defaultconfigs/bareos-sd.d/device-tape-with-autoloader.conf Diff File

bareos: bareos-14.2 75ba3f22

2014-12-04 14:37

joergs


Committer: mvwieringen

Ported: N/A

Details Diff
added hint how to preserve foreign tapes

Fixes 0000351: Detect and refuse to write Label on LTFS formatted tapes
Affected Issues
0000351
mod - src/defaultconfigs/bareos-sd.d/device-tape-with-autoloader.conf Diff File

bareos2015: bareos-14.2 0bfb74c1

2014-12-04 15:37

joergs


Committer: mvwieringen

Ported: N/A

Details Diff
added hint how to preserve foreign tapes

Fixes 0000351: Detect and refuse to write Label on LTFS formatted tapes
Affected Issues
0000351
mod - src/defaultconfigs/bareos-sd.d/device-tape-with-autoloader.conf Diff File

Issue History

Date Modified Username Field Change
2014-10-18 23:18 elonen New Issue
2014-10-19 16:10 mvwieringen Note Added: 0001012
2014-10-19 16:10 mvwieringen Assigned To => mvwieringen
2014-10-19 16:10 mvwieringen Status new => feedback
2014-10-19 18:24 elonen Note Added: 0001017
2014-10-19 18:24 elonen Status feedback => assigned
2014-10-19 19:39 mvwieringen Note Added: 0001018
2014-10-19 19:39 mvwieringen Assigned To mvwieringen =>
2014-10-19 19:39 mvwieringen Status assigned => feedback
2014-10-19 20:58 elonen Note Added: 0001021
2014-10-19 20:58 elonen Status feedback => new
2014-10-30 20:29 joergs Note Added: 0001026
2014-12-01 15:34 joergs Assigned To => joergs
2014-12-01 15:34 joergs Status new => assigned
2014-12-05 22:38 joergs Changeset attached => bareos master 6448016e
2014-12-05 22:38 joergs Note Added: 0001100
2014-12-05 22:38 joergs Status assigned => resolved
2014-12-05 22:38 joergs Resolution open => fixed
2014-12-12 02:02 mvwieringen Changeset attached => bareos bareos-14.2 75ba3f22
2014-12-12 02:02 mvwieringen Note Added: 0001105
2014-12-12 02:02 mvwieringen Assigned To joergs => mvwieringen
2015-01-26 16:02 mvwieringen adm Assigned To mvwieringen =>
2015-01-26 16:08 mvwieringen adm Status resolved => closed
2015-03-25 16:51 mvwieringen Changeset attached => bareos2015 bareos-14.2 0bfb74c1
2015-03-25 16:51 mvwieringen Note Added: 0001453
2015-03-25 16:51 mvwieringen Status closed => resolved
2015-03-25 19:19 joergs Note Added: 0001603
2015-03-25 19:19 joergs Status resolved => closed