Last Updated on August 5, 2022 by Thiago Crepaldi
In this post we are going to configure a NFS share on our Synology NAS so that Proxmox Backup Server can use it as storage (aka Datastore) for all VMs and container backups.
The first step is to configure NFS share on your Synology, then we need to mount the NFS share on the server running the PBS and lastly we configure a Datastore on the pBS pointing to the folder where the NFS was mounted.
Enabling NFS on the Synology NAS
After login in to your Synology, go to Control Panel >> File Services and scroll down to NFS. By default, NFS is disabled. To enable it, check both “Enable NFS”, “Enable NFSv4 support” and click on Apply.
Create NFS share
Now that you have enabled NFS on your DSM, let’s create a share with it. go to Control Panel >> Shared Folder and click on Create. A wizard will appear:
- Set up basic information
- Name: Proxmox Backup Server
- Description: NFS storage for PBS datastore
- Location: pick the appropriate volume, preferably one that is fault tolerant for at least one disk
- Hide this shared folder in “My network Places”: checked
- Hide sub-folders and files from users without permission: checked
- Enable recycle bin: unchecked
Click on Next
- Encryption
- Encrypt this shared folder: unchecked
Click on Next
- Configure advanced settings
- Enable data checksum for advanced data integrity: unchecked
- Enable shared folder quota: unchecked
Click Next to show a confirmation screen. If everything looks ok, click Apply to create the share.
Once your shared folder has been created, you will be redirected to the Permissions tab, where you need to change all users except your admin account to have No Access.
At this point, you have a shared folder, but it doesn’t have NFS configured. Lets change that by going to NFS Permissions tab and clicking on Create.
- Create a NFS rule
- Hostname or IP: Add the IP/hostname of your PBS
- Privilege: Read/Write
- Squash: No mapping
- Security: sys
- Enable asynchronous: checked
- Allow connections from non-privileged ports: unchecked
- Allow users to access mounted subfolders: unchecked
Click Ok to create the NFS rule and take note of the Mount path at the bottom of the page. This is the path you will need to use on the PBS NFS client later.
Mounting NFS share from Proxmox Backup Server
Login to your PBS and go to Administration >> Shell. At the terminal, make sure you have NFS client installed – it should already be installed by default
# apt update
# apt install -y nfs-common
Now we need to create a folder which will be host the NFS mount point and manually mount the Synology share as a test. This is where you are going to use the mount path you took note when configuring NFS rule at your Synology
# mkdir -p /opt/NFSfromSynology
# chown backup:backup /opt/NFSfromSynology
# chmod 775 /opt/NFSfromSynology
# mount synology_hostname:/volume1/ProxmoxBackupServer /opt/NFSfromSynology/
# touch /opt/NFSfromSynology/test_file
After this, you should see a test_file inside ProxmoxBackupServer share on your Synology. Use File Station app on your Synology to verify.
We will also add an entry at /etc/fstab to mount this share point automatically during boot.
# echo "synology_hostname:/volume1/ProxmoxBackupServer /opt/NFSfromSynology/ nfs defaults 0 0" >> /etc/fstab
As a test, we will manually unmount the NFS share and ask the OS to mount it. In between unmounting and mounting again, we try to list files in the mount point. Only after mounting it should show test_file created before.
# umount /opt/NFSfromSynology/
# ls /opt/NFSfromSynology/
# mount -a
# ls /opt/NFSfromSynology/
Adding a Datastore on your Proxmox Backup Server
Now that the NFS share from Synology is mounted on your PBS server, we can use it as a Datastore. On your PBS web UI, click on Datastore >> Add Datastore button
- Add Datastore
- Name: NFSfromSynology
- Backing path: /opt/NFSfromSynology
- GC schedule: daily
- Prune schedule: daily
- Comment: NFS share from Synology to store PBS backups
Click Add to complete. After around 30s, you will see a timeout error (aka Connection error – Timeout.). This is a known issue on PBS and it is safe to ignore. Close the Datastore creating window and wait a little longer until you see a “NFSfromSynology” entry under Datastore on the left menu.
With this, we now have a datastore, but it is not quiet usable just yet. We need to give access/permissions to users to use the datastore. In this example we are going to create a new user, so go to Configuration >> Access Control >> User management and click at Add
- Add user
- User name: pbs_client
- Password: be creative here
- Confirm password: confirm you are creative
- Expire: never
- Enabled: checked
- First name: PBS
- Last name: Client
- E-mail: your email
- Comment: PBS user that shall be used by PVE to access datastores
Click Add and verify a new user is listed. Note its realm is “pbs“, so the new user created is pbs_client@pbs!
Let’s give pbs_client@pbs access to NFSfromSynology. Through the left menu, go to Datastore >> NFSfromSynology >> Permissions. Click on Add >> User permission and pick pbs_client@pbs from the list, select DatastoreBackup as its Role and finish off by clicking Add. Now the datastore is usable, at least for pbs_client@pbs!
Because we use (for now) self-signed certificates, we need to get the PBS fingerprint so that PVE can trust on the PBS. Go to Administration >> Shell and run the following command and take note the output. It should be 32 hex octets, like ab:cd:ef:01:12:…:ff
# proxmox-backup-manager cert info | grep Fingerprint
Configuring Proxmox Virtual Environment to use the PBS datastore
On your Proxmox Virtual Environment, go to Storage View >> Datacenter >> Storage and click on Add followed by Proxmox Backup Server
- Add Proxmox Backup Server
- General
- ID: PBS_YOUR_SERVER_HOSTNAME (or any friendly name)
- Server: Your server IP or hostname
- Username: pbs_client@pbs
- Password: ********* (tu dun ts)
- Nodes: All
- Enabled: True
- Content: backup
- Datastore: NFSfromSynology
- Fingerprint: Copy & Paste from previous steps
- Backup retention:
- Keep all backups: checked
- you can tweak this section to your need
- Keep all backups: checked
- Encryption
- Do no encrypt backups
- General
Click Add to complete and verify the new entry is displayed in the Storage page.
Backing up a Proxmox Container
To test our new PBS storage, let’s backup a Proxmox container. Go to Folder view >> Datacenter >> LXC Container and select one of your containers. Next, click on Backup followed by Backup now button
- Backup CT <xxx>
- Storage: PBS_YOUR_SERVER_HOSTNAME
- Mode: Snapshot
Click Backup to start. A dialog with logs will be displayed. If everything went well, you should see several logs, but the last two should be something like
INFO: Backup job finished successfully
TASK OK
Backing up a Proxmox Virtual Machine
You can do similar test for a Virtual Machine. Go to Folder view >> Datacenter >> Virtual Machine and select one of your VMs. Next, click on Backup followed by Backup now button
- Backup VM <xxx>
- Storage: PBS_YOUR_SERVER_HOSTNAME
- Mode: Snapshot
Click Backup to start. A dialog with logs will be displayed. If everything went well, you should see several logs, but the last two should be something like
INFO: Backup job finished successfully
TASK OK
That is it, enjoy your backups on a remote storage server!
Hi, thanks for posting these well written instructions. These instructions worked for me, however I am getting an error on the dashboard under “datastore usage” section that shows: Bad Request (400)
unable to open chunk store ‘NFSfromSynology’ at “/opt/NFSfromSynology/.chunks” – Permission denied (os error 13). Do you have this same error? Please let me know. Thanks.
Try chmoding the share to 755 as opposed o 770 and let me know how it goes
Thanks for the detailed instructions. I have carried out everything according to these instructions. Unfortunately I get an error message in Proxmox: permission denied (os error 13) (500) what can I do?
Try changing permissions from 700 to 775 in the steps above
Thanks for this post!
Just one thing you have to change
chmod 770 /opt/NFSfromSynology -> chmod 775 /opt/NFSfromSynology
Otherwise it dont work for me.
Thanks, that did it for me!
where did backup user came?
This is a standard user on Linux distributions. Doesn’t your proxmox box have it?
I get error when trying to mount: mount.nfs failed to resolve server name or service not known
That means your hostname is wrong on the the following step: