Found a nice little way to get PBS to accept a datastore that is read-only and restore backups from it.
My use case is as follows:
Now we can add this /mnt/merged dir as a datastore in PBS when we go in the UI and do a add datastore > tick advanced > tick Reuse existing datastore
Overall, I think it would be a good idea for PBS to support mounting datastores temporarily as a read-only datastore (to account for this situation where the PBS datastore is read-only) just for a single restore to PVE so that when s hits the fan, you can restore your vms/containers.
Unless someone has found an easier method to do this maybe with just plain old proxmox-backup-client that would work as well. But I found this to work also.
My use case is as follows:
- PBS does backups to my hard drive.
- Another script runs borgbackup to backup the PBS datastore to all my other devices/backup destinations.
- If PVE and PBS both go down/die, you need to setup another PVE instance to restore your vms/containers to from your datastore (that is now only backed up through borgbackup).
- Mount borg archive to folder on filesystem that hosts borg repo.
- Mount it inside new PBS instance with sshfs.
- PBS won't accept this as a datastore if you try and add it in (os error 1) due to not have write permissions. So we will make an overlayfs with a lowerdir and upperdir and a merged overlayfs that PBS will be able to write too (which will allow us to restore our vms/containers.
Code:
root@pbs /mnt
# mkdir /mnt/upper /mnt/work /mnt/merged /mnt/PBS
root@pbs /mnt
# sshfs root@borg:/root/borg-repo-fuse /mnt/PBS -o uid=34,gid=34
root@pbs /mnt
# mount -t overlay overlay -o lowerdir=/mnt/PBS,upperdir=/mnt/upper,workdir=/mnt/work /mnt/merged
Now we can add this /mnt/merged dir as a datastore in PBS when we go in the UI and do a add datastore > tick advanced > tick Reuse existing datastore
Overall, I think it would be a good idea for PBS to support mounting datastores temporarily as a read-only datastore (to account for this situation where the PBS datastore is read-only) just for a single restore to PVE so that when s hits the fan, you can restore your vms/containers.
Unless someone has found an easier method to do this maybe with just plain old proxmox-backup-client that would work as well. But I found this to work also.
Last edited: