Alan,

My bacula experience is with 13.x and 15.x. I have not used bacula 9.6.7. I
believe most of what I am about to say is probably relevant to 9.x, but I
recommend double checking just in case.

In your position, I would prefer to adjust the catalog via
bconsole/bacularis/baculum, not to edit the database directly. This isn't
just because editing databases is tricky, but because bacula has certain
logic it uses when interacting with the database, and we don't want to
create a state unexpected by the developers by manually editing the
database. This could lead to problems down the line.

I don't know if you would be able to restore files from the interrupted
backups, and even if you could, they would be of limited use because they
are only partial backups. I assume that your goal is to regain the use of
your disabled volumes, and clean up spurious entries in the catalog related
to the interrupted jobs and their files.

If your goal isn't to remove all relevant database entries and reuse the
volumes related to these failed jobs, please reply with more information.

Regarding catalog cleanup and volume reuse, this is my understanding:
File entries without a job are pruned from the catalog.
Job entries without a volume are pruned from the catalog.
Volume entries without any job entries are recycled (assuming the volume is
set to be recyclable).
Job entries can exist without any file entries. This is possible if one
sets file retention < job retention. This would save database space by
pruning file records for older backups, while still being able to restore
those older backups. The downside is that you would have to restore the
whole job even if you only needed a certain file.

The following is a high level overview. I do NOT recommend you manually
edit the database unless you know what you're doing. This is so bacula can
do the cleanup for you.

Towards this end, I think the best move would be to:
0. Take a backup of your catalog, and restore it to a safe place. This is
just in case something goes wrong. REALLY. *Not just take the backup, also
restore it. *That way you have the bacula.sql file ready, even if bacula
itself has been rendered unusable.

1. Save a copy of the interrupted joblogs, so you  can reference them later
(we need to know which volumes are used by the failed jobs, and the jobids
of the failed jobs).

2. Delete the jobs in question. This should remove the file entries related
to the jobs.

3. Check the volumes used by the failed jobs. Were the volumes used with
any non-expired job other than the failed jobs? The failed jobs you deleted
in step 2 shouldn't appear on the following checks.

(The easiest way to do this is via the volumes tab in bacularis / baculum
(select volume, click details button, select 'jobs on volume' tab). If you
only have bconsole, the command 'echo list jobmedia volume=
Your-Case-Sensitive-volume-name | bconsole' should list all jobs that have
written to the volume. In my testing, sometimes a given job is listed
multiple times. I'm guessing this might be start and stops, if the job had
to spool data. Not sure.)

  3a. If the volume contains data from jobs other than the failed jobs, we
don't want to recycle those volumes unless you are comfortable losing the
data from the non-failed jobs. [*STOP*, unless you are comfortable losing
all data in the impacted volumes.]
  3b. If the volume only contains data from the failed jobs, we can safely
reuse the volumes. If you deleted all the failed jobs in step 2, and if no
other jobs were written to the volumes, then you may not get any output
here. [Continue to 4.]

4. To make the volumes eligible for reuse, I recommend you purge the
volumes. (Purge = 'prune without any respect for retention periods or other
factors'). Please be careful with the purge command in bconsole. Merely
running 'purge' without specifying which volume will lead to an interactive
experience where it will quickly purge all catalog entries related to
whatever FD you selected, without any warning. The (slightly safer but
still dangerous) bconsole command to purge a specific volume is "purge
volume="Your-Case-Sensitive-volume-name" yes".

In a general sense, I believe this should remove all database entries
related to the failed jobs, their volumes, and any file entries, and make
the volumes eligible for reuse. I recommend running a small test backup job
to make sure the volumes are reused as expected, and that the backup data
is written to the beginning of the tape, not to wherever the last job left
off.

I welcome anyone else cross checking my work here, to be sure I didn't miss
something or make an error.

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


On Wed, Nov 26, 2025 at 8:14 AM Alan Polinsky <[email protected]>
wrote:

> My version of Bacula, 9.6.7 have been running on my Slackware box for
> quite awhile. Unfortunately, in the past year I've had some electrical
> work done that has stopped various backups mid stream. When that has
> happened, the volume in progress has marked the VolStatus as 'Disabled'.
> In order to re-use those volumes, I have used SQL to mark them as
> 'Recycle'. Is there a way to synchronize the MariaDb tables with the
> current contents of all media? My storage device is LTO3.
>
> Thank you.
>
>
> Alan
>
>
>
> _______________________________________________
> 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