Hello!
I am using Bacula 9.6.7 on Debian 10.x with Postgres database and
several disk/file and tape pools.
Backup is first sent to a pool containing file volumes on the disk
and after that, successful backup jobs are copied to a pool of
tapes using a Copy job.
That works as expected and I never had problems with that.
What doesn't work is the procedure for restoring from the pool of
tapes containing copies of the backup jobs.
In general, the command "restore copies client=clientname" or
"restore copies pool=poolname" should work but in my case it doesn't.
I believe that "copies" argument worked with Bacula 7.4 but cannot
confirm that any more.
I would be grateful if someone could try to restore a file from a copy
job and report the result together with the Bacula version.
In my case MediaType used for the disk pool is "disk2" and for the tape
pool it is set to "tape1".
I am using HP Ultrium LTO7 tape drive (no autochanger).
When I use "restore copies client=t-build-1-fd" command, I get the list
of both, backup jobs and copy jobs:
+---------+----------------------------------+-----------+-----------+
| jobid | job | copyjobid | mediatype |
+---------+----------------------------------+-----------+-----------+
| 129,253 | t-build-1.2021-11-29_13.57.19_09 | 129,256 | Tape1 |
+---------+----------------------------------+-----------+-----------+
+---------+-------+----------+---------------+---------------------+--------------+
| jobid | level | jobfiles | jobbytes | starttime | volumename
|
+---------+-------+----------+---------------+---------------------+--------------+
| 129,253 | F | 67,101 | 1,183,688,394 | 2021-11-29 13:36:29 |
diskvol-1536 |
+---------+-------+----------+---------------+---------------------+--------------+
You have selected the following JobId: 129253
Building directory tree for JobId(s) 129253 ...
+++++++++++++++++++++++++++++++++++++++++++++
61,016 files inserted into the tree.
However, when I proceed, Bacula chose to use disk2 pool containing
backup jobs instead of the tape1 pool containing copied jobs:
29-Nov 16:04 p-bkp-1-dir JobId 129801: Using Device "tape1-dev1" to read.
29-Nov 16:04 p-bkp-1-sd JobId 129801: acquire.c:115 Changing read device. Want
Media Type="File2" have="Tape1"
Tape device="tape1-dev1" (/dev/tape/by-id/scsi-3500507631216d57b-nst)
29-Nov 16:04 p-bkp-1-sd JobId 129801: Media Type change. New read File device
"disk2-dev1" (/data/disk2/volumes) chosen.
29-Nov 16:04 p-bkp-1-sd JobId 129801: Ready to read from volume "diskvol-1536"
on File device "disk2-dev1" (/data/disk2/volumes).
If I try to use restore like this: "restore copies pool=tape1
client=t-build-1-fd"
I get message such as this:
No Full backup before 2021-11-29 14:04:10 found.
If I try to use restore by setting storage like this:
"restore copies client=t-build-1-fd storage=p-bkp-1-sd-tape1"
everything looks fine at first but restore get stuck for approx.
5 minutes with the following status description:
't-build-1-restore is waiting on Storage "p-bkp-1-sd-tape1"'
Approximately 5 minutes later, restore job fails with the following
error (no other jobs are running at the moment):
29-Nov 14:14 p-bkp-1-sd JobId 129258: Fatal error: Device reservation failed
for JobId=129258:
29-Nov 14:14 p-bkp-1-dir JobId 129258: Fatal error:
Storage daemon didn't accept Device "tape1-dev1" because:
3924 Device "tape1-dev1" not in SD Device resources or no matching Media
Type or is disabled.
This is interesting because the device "tape1-dev1" is (IMHO) correctly
set in the SD configuration as well as Media Type. I checked the database
entries to be sure that pool and storage resources are correctly synced
with the database.
I don't think that I have missed something but here is the relevant
part of the SD and DIR configuration...
# Bacula SD config
####
Autochanger {
Name = p-bkp-1-sd-tape1
Device = tape1-dev1
Changer Command = ""
Changer Device = /dev/null
}
Device {
Name = tape1-dev1
Drive Index = 0
Device Type = Tape
Media Type = Tape1
Archive Device = /dev/tape/by-id/scsi-3500507631216d57b-nst
AutoChanger = no
LabelMedia = no
Random Access = no
AutomaticMount = yes
RemovableMedia = yes
AlwaysOpen = no
Requires Mount = no
SpoolDirectory = /var/spool/bacula/spool
Maximum Spool Size = 135G
Maximum Concurrent Jobs = 4
Control Device = /dev/tape/by-id/scsi-3500507631216d57b-nst
Alert Command = "sh -c 'smartctl -H -l error %c'"
}
# Bacula DIR config
####
Autochanger {
Name = p-bkp-1-sd-tape1
Address = p-bkp-1.bkp.localdomain
SDPort = 9103
Password = "strong_password"
Device = tape1-dev1
Media Type = Tape1
Autochanger = p-bkp-1-sd-tape1
Maximum Concurrent Jobs = 10
TLS Enable = yes
TLS Require = yes
TLS CA Certificate File = /etc/bacula/certs/localdomainBackupCAChain.crt
TLS Certificate =
/etc/bacula/certs/dir-storage-client_p-bkp-1.bkp.localdomain.crt
TLS Key = /etc/bacula/certs/dir-storage-client_p-bkp-1.bkp.localdomain.key
}
Pool {
Name = "tape1"
Pool Type = Backup
Storage = "p-bkp-1-sd-tape1"
AutoPrune = yes
Volume Retention = 12 months
Recycle = no
Label Format = "tapevol-"
}
Kind regards!
--
Josip Deanovic
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users