Proxmox Backup - Use a Synology as storage via NFS

Proxmox Backup - Use a Synology as storage via NFS

As an offsite backup for my lab, I use a microPC that's at home. I recently replaced my old QNAP with a Synology NAS. But apparently, NFS management is a bit stricter on Synology.

Indeed, knowing that on Proxmox Backup access is segmented, the user who must access the NFS storage is not the root (and fortunately).

The problem is that the backup user ID on the Synology NAS must be the same as on the Promox Backup server.

Below are the steps to follow to use a Synology NAS server to store backups on it.

Storing backups on an NFS share is not recommended on Proxmox Backup. This is not officially supported, and is not recommended in the professional world.

Retrieve the backup user ID from the backup server

First, retrieve the backup user ID from the Proxmox Backup server. To do this, log in via SSH to the server and type the following command:

id backup

The output should look like this:

uid=34(backup) gid=34(backup) groups=34(backup),26(tape)

So in our example above, the ID is 34. Make a note of it for later use.

Configure user on Synology

We assume that the shared folder is already created on the Synology, and that the NFS service is enabled.

Log in to the Synology web interface, create a "backup" user, and give them access rights to the folder.

At the time of creation, there are no particular points to take into account

Then connect to the server via SSH (disabled by default, if this is the case, you will need to activate it temporarily. It can be activated in the Control Panel > Terminal and SNMP)

We will modify the passwd file to define the UID of the backup user. Open this file with the following command:

sudo vi /etc/passwd

Find the line containing our backup user, it should look like this:

backup:x:1030:100::/var/services/homes/backup:/sbin/nologin

In our example, 1030 is the UID to modify, we can replace it with our previously retrieved UID (in our example, 34)

Reminder: the "i" key allows you to enter text, the "esc" key to stop editing, ":w" to save, and ":q" to exit vi

Once done, we can log out over SSH, and re-disable the service if it was the case before.

Go to the folder's NFS sharing settings, and set the parameters as below:

  • Hostname/IP: Enter the IP address of the Proxmox Backup server
  • Privilege: Reading/Writing
  • Squash: No mapping
  • Security: leave sys
  • Check the last 3 options

Save everything, and disconnect from the Synology server

Mount the mount point

We can now connect to the mount point. To do this, connect via SSH and type the following command:

mkdir /mnt/DOSSIER_LOCAL
mount IP:/VOLUME/SHARE /mnt/DOSSIER_LOCAL/

Replace the above values with:

  • LOCAL_FOLDER: mount point on the Proxmox Backup server
  • IP: IP address of the Synology server
  • VOLUME: storage volume where the share is located
  • SHARE: name of the shared folder

Take advantage of adding the line in the fstab file so that the mounting is done automatically at startup:

IP:/VOLUME/SHARE /mnt/DOSSIER_LOCAL/ nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0

Once done, all that remains is to restart the Proxmox Backup server and the Synology