External PBS copy

wernii

New Member
Aug 24, 2020
10
0
1
42
Hello
I have a problem like making a copy from the PBS server to an external medium as a copy outside the company's premises? In my case it is an external hard drive.
 
Hi,

currently, this can be achieved by doing a local sync job.

  1. Add the path where the external hard-drive will be mounted as datastore
  2. Add the PBS instance itself as "local" remote (just use localhost, 127.0.0.1 or ::1 as server address)
  3. Add a sync job to the datastore of the external hard disk, use the "fake" local remote and the desired source datastore where you want to pull the syncs from.
    Set either no schedule at all and run that job only manually, or if the external drive is normally always attached you can also just configure a sync schedule as normally.
Edit 2024-03-13: Since Proxmox Backup Server 3.1 sync jobs support syncing from local datastores natively, you can select a local source directly in the datastore.
 
Last edited:
  • Like
Reactions: BruceX and Elleni
Hi,

currently, this can be achieved by doing a local sync job.

  1. Add the path where the external hard-drive will be mounted as datastore
  2. Add the PBS instance itself as "local" remote (just use localhost, 127.0.0.1 or ::1 as server address)
  3. Add a sync job to the datastore of the external hard disk, use the "fake" local remote and the desired source datastore where you want to pull the syncs from.
    Set either no schedule at all and run that job only manually, or if the external drive is normally always attached you can also just configure a sync schedule as normally.
Thank you for your answer. But wouldn't it be possible to do it somehow in the form of an export, e.g. via LAN to another server?
Or as export to cloud?
 
Thank you for your answer. But wouldn't it be possible to do it somehow in the form of an export, e.g. via LAN to another server?
Or as export to cloud?
If you can mount your cloud drive or whatever you are using to your PBS instance, a sync job to localhost would probably be the best way.
 
If you can mount your cloud drive or whatever you are using to your PBS instance, a sync job to localhost would probably be the best way.
How to do it? I can't see this PBS documentation.

I would just like to say that it is about making a copy of what is in Datastore, in my case only VMs - but in a version so that they are saved in one copy, which is taken outside the company's premises.
 
How to do it?
Quick rundown:
  1. Mount your drive to the location you want (e.g. /mnt/), in this example we will use /the/mountpoint/of/the/drive.
  2. Add a Datastore and point it to the external drive:
    1604074322561.png
  3. Now add the PBS itself as a "Remote" like so:
    1604074426189.png
    You will need to set the Userid to a user that actually exists and has rights to the datastores, as it is local you might as well use root@pam here. Enter the fingerprint of your PBS Server. The "Host" is set to localhost since we want to sync to a drive connected to the PBS itself.
  4. Click on your newly created Datastore (here called my-external-drive), switch to "Sync Jobs" and add a Sync Job like this:
    1604074623365.png
    Make sure to enter your "real" Datastore in the "Source Datastore" field, in my case that is store02. Choose a Schedule that fits you or just delete the text in "Schedule" to make it a manual task.
  5. Run the Sync Job for the first time.
Thats it, you are now syncing your source datastore to a datastore on your external drive.
 
Last edited:
  • Like
Reactions: Elleni
Quick rundown:
  1. Mount your drive to the location you want (e.g. /mnt/), in this example we will use /the/mountpoint/of/the/drive.
  2. Add a Datastore and point it to the external drive:
    View attachment 20832
  3. Now add the PBS itself as a "Remote" like so:
    View attachment 20833
    You will need to set the Userid to a user that actually exists and has rights to the datastores, as it is local you might as well use root@pam here. Enter the fingerprint of your PBS Server. The "Host" is set to localhost since we want to sync to a drive connected to the PBS itself.
  4. Click on your newly created Datastore (here called my-external-drive), switch to "Sync Jobs" and add a Sync Job like this:
    View attachment 20834
    Make sure to enter your "real" Datastore in the "Source Datastore" field, in my case that is store02. Choose a Schedule that fits you or just delete the text in "Schedule" to make it a manual task.
  5. Run the Sync Job for the first time.
Thats it, you are now syncing your source datastore to a datastore on your external drive.


Thank you very much for the tutorial. I also have a question whether the external drive must have the same capacity as the Datastore, in the photo:
datastore.png
 
Thank you very much for the tutorial. I also have a question whether the external drive must have the same capacity as the Datastore, in the photo:
View attachment 20835
It doesnt have to be the same capacity, but you should have more capacity than storage space beeing used on your main pool.
So in your case any drive >172GiB is sufficient. Those storage requirements will probably grow in the future though, so make sure you get a large enough drive.
 
How do you deal with the problem that as long as the removable media is disconnected you get an error on the dashboard / datastore usage section? Do you remove the datastore before unplugging the external disk?
 
Last edited:
I used these excellent instructions to sync a datastore to a shared folder on a Synology NAS using the following command to mount it on the PBS server:
mount -t cifs "//172.16.0.66/foobar" -o username=MYUSER,password=MYPASS,vers=2\.0 /mnt/foobar.

I then followed the rest of your instructions and it worked fine and I can see the backups in the PBS GUI when I look at the content of the datastore.

My question, however is about what this looks like on the Synology side.

The directory I backed up to has been in use for VZDumps, so it has all the usual directory structure for that. When I first mounted the directory before doing a sync, it looked like this:

ls configuration_backups dump id_rsa.pub images old_deletable private scripts server_backups snippets template test.txt vztmp

After I did the sync, none of those directories are visible any more, but there is a new directory structure :

ls -al total 1044 drwxr-xr-x 4 backup backup 4096 Nov 16 15:06 . drwxr-xr-x 5 root root 4096 Nov 16 14:36 .. drwxr-x--- 1 backup backup 1056768 Nov 16 14:59 .chunks -rw-r--r-- 1 backup backup 0 Nov 16 14:59 .lock drwxr-xr-x 3 backup backup 4096 Nov 16 15:06 vm

When I look on the NAS's file browser itself, all the old dirs/files still appear, and ".chunks" and ".lock" appear, but I don't see the vm directory and its contents.

This is not necessarily a problem (since it all seems to work), but it is puzzling. Can anyone explain what is going on?
 
And I have a problem with step 2, which is adding to storage. I have this error:

1606337325554.png


Please help me what should I do with it.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!