Marco,

Your idea sounds right in theory, but I have not done that.

I know I have 'reused' tapes in bacula that were previously part of a
different pool. I don't remember what I did, but for tapes that were not
100% full of data, bacula chose to go to the eof marker and then start
writing new data. So on brand new, never used before tape, Full job 1
started at the beginning of tape 1. Full job 2, ran on the 'reused' tape
that was moved to another pool started at the middle of the tape.

To avoid this, I did the following old, manual process to present the tapes
as entirely new tapes to bacula:

1. delete the tapes in bacula. I used bacularis.
1.1 run a prune command to make sure associated jobs and file records have
all been pruned from the catalog.
in bconsole do:
prune volume allpools
This will prune all jobs that are eligible. I don't know if this step is
necessary but I would recommend it just in case. If you don't want to prune
all jobs jobs that are past their retention, instead specify the volume
name.

2. Now that the volume has been deleted from bacula, and all records of
data related to that volume are gone, we will rewind the tape and write and
'eof' mark to the front of the tape. This will prevent the tape drive from
seeking past the mark and make all previous data inaccessible without
specialist tape drive hardware. This is a destructive procedure. I
recommend making a list of tapes to do this on, double and triple check the
list, and remove all other tapes from the tape drives and autochanger. then
insert only the tapes you plan to truncate. Manually load your tape into
the drive using the autochanger gui, or using mtx.
I assume that your tape drive is /dev/st0. Change the below commands if
that is not the case for you.

This command will:
request tape status.
rewind the tape
write eof to the tape
request the status.

#sudo mt -f /dev/st0 status && sudo mt -f /dev/st0 rewind && sudo mt -f
/dev/st0 eof && sudo mt -f /dev/st0 status

Repeat this process for each tape. Be REALLY SURE that you have the right
tapes in the drive.

3. Do an update slots to refresh bacula's knowledge of what tapes are in
the changer. I've always used the bacularis, 'update slots' button in the
volume tab, so I don't have the bconsole command memorized. I'm sure you
are familiar with this process.

4. Relabel the tapes in bacularis. From the volume tab in bacularis:
We need to write the tape labels to the beginning of the target tapes.
These labels were previously wiped out by our process involving mt.
at top of page, click 'label volumes'.
Check 'use barcode as label'.
enter the autochanger slots that the target tapes are using.
select appropriate storage.
Select pool Scratch (unless you're certain you want another pool, but
Scratch is probably the correct choice for a mass-import of reused media).
Click ok.
The tape labeling process will run for a while. Bacula will automatically
load tapes as needed, write a new label to the beginning of the tape, then
unload that tape and load the next.
Please be patient and leave the bacularis tab and tape labeling dialog
window open while the process works (just in case, and to see the progress
reports as the tapes are labeled).

End of process. The tapes should now be in bacula's volumes list, showing
as empty, with the same volume names as before (assuming the volume names
were based on barcode labels previously).

Regards,
Robert Gerber
402-237-8692
[email protected]


On Tue, Nov 11, 2025 at 4:41 PM Marco Gaiarin <[email protected]>
wrote:

> Mandi! Arno Lehmann via Bacula-users
>   In chel di` si favelave...
>
> > I see "recycle=0" or, in Bacula Pool Directive terms, "Recycle = No".
>
> Sorry; considering that i know that tapes does not contain useful data, to
> manually recycle i need to:
>
>  1) purge it
>
>  2) truncate it
>
>  3) manually set/update volume to 'Append' status
>
>
> Right? Thanks.
>
> --
>
>
>
>
> _______________________________________________
> Bacula-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to