Swap backup drives

t0mz

Member
Jan 20, 2022
41
6
13
25
My backups go to an external drive which is mounted to /media/backup. What I try to achieve is that I replace this drive with a different one whenever appropriate and have PBS continue to use that drive. The new drive might be empty or a hold an older version of the datastore.
Now, it turns out that things aren't that easy. It seems I have to manually recreate the on-drive parts of the repository, folder structure, namespaces, etc. Which is ok, because I can script this.
However, I am stuck now with the below and wonder if I might be hitting a security token issue making what I want to do impossible?

Code:
INFO: Error: inserting chunk on store 'BackupDrive' failed for 88885c27a95d2b841e24a1f8030ab3b25c9
c6714e3b0a368afdc7910419863af - mkstemp "/media/backup/PBS/.chunks/8888/88885c27a95d2b841e24a1f8030ab3b25c9c6714e3b0a368afdc7910419863af.tmp_XXXXXX" failed: ENOENT: No such file or directory

INFO: cleanup temporary 'vzdump' snapshot

ERROR: Backup of VM 102 failed - command 'lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- /usr/bin/proxmox-backup-client backup '--crypt-mode=none' pct.conf:/var/tmp/vzdumptmp3333297_102/etc/vzdump/pct.conf root.pxar:/mnt/vzsnap0 --include-dev /mnt/vzsnap0/./ --skip-lost-and-found '--exclude=/tmp/?*' '--exclude=/var/tmp/?*' '--exclude=/var/run/?*.pid' --backup-type ct --backup-id 102 --backup-time 1762935038 --entries-max 1048576 --repository root@pam@172.20.0.2:BackupDrive --ns PVE2' failed: exit code 255

INFO: Failed at 2025-11-12 09:10:40

INFO: Backup job finished with errors

INFO: notified via target `mail-to-root`

TASK ERROR: job errors

The folder structure is there, /media/backup/PBS is owned by backup:backup. I was able to recreate the namespaces through the UI, which I guess means the service is able to write to that folder structure in principle.

I could of course delete and recreate the datastore, but that would mean new fingerprints and updating all clients which I don't want to do.
Anyone got an idea what might be missing still, or an alternative approach to achieve my goal of multiple alternating backup drives?