How to make a shared folder from Synology accessable from Ubuntu (boot persistent)

Iḿ make progress with small steps on Ubuntu.
I thought I had everything working and could move Openhab from Synology to Ubuntu but one thing I can´t get working

I created a shared folder on the Synology. I followed the steps A Guide To Setting up NFS on Synology NAS

I can access the folder from Ubuntu after I select Networking and login with the special created user and password connected to the shared folder on the Synology.
But when I reboot Ubuntu it is not working anymore.

What did I do to get this work.

  1. sudo mkdir /nfs/backup_nuc
    The name backup_nuc is the same as I created on the Synoloy
  2. Added the line below to /etc/fstab
    192.168.100.51/volume1/backup_nuc /nfs/backup_nuc nfs auto,noatime,nfsvers=4

What I can´t find is where to add the username and password?
And also why I need to create a folder in nfs
I hope again somebody can help.

NFS doesn’t use username password for authentication it uses the IP address of the client.

But how can I create access on Ubuntu after a reboot?

fstab has to be:

192.168.100.51:/volume1/backup_nuc /nfs/backup_nuc nfs default 0 0

most importantly notice the colon after the IP address

mount -a
systemctl -q daemon-reload

As Wolfgang said, you need to make sure, you add the IP address on NFS Permissions tab (step 4 of the guide you linked).

Why do you want a shared folder set up? If it’s for backing up data from Ubuntu to Synology, wouldn’t rsync be a better option?

Thanks.

Does this mean you map the Synology drive to a local drive in this case /nfs/backup_nuc?
If yes I assume I need to write to the local drive

echo "Backing up openhab"
file=/nfs/backup_nuc/openhab-$(date +%Y-%m-%d_%H%M).tgz
cd /home/mynuc/docker/openhab4.1.1
tar cfz $file .

When I do this I get a no access error

tar (child): /nfs/backup_nuc/openhab-2024-02-13_0817.tgz: Functie open() is mislukt: Toegang geweigerd

Yes I did this. IP address of the NUC

Yes. This is what you tried to achieve with your first post, isn‘t it?
Let‘s start with easy tests first:
what is the output of

cd /nfs/backup_nuc
touch delete.me
ls -al

did you run these commands, too?
mount -a
systemctl -q daemon-reload

Is in Dutch but says no access
touch: kan tijdsstempels van ‘delete.me’ niet wijzigen: Toegang geweigerd

yes I did.

ls -al
totaal 8
drwxr-xr-x 2 root root 4096 feb 12 16:37 .
drwxr-xr-x 4 root root 4096 feb 12 16:37 …

with adding rights sudo chmod a+rwx . I can create a file but I don´t see that file on my synology

mynuc@mynuc-desktop:/nfs/backup_nuc$ ls -al
totaal 169680
drwxrwxrwx 2 root root 4096 feb 13 09:59 .
drwxr-xr-x 4 root root 4096 feb 12 16:37 …

echo "Backing up openhab"
file=/nfs/backup_nuc/openhab-$(date +%Y-%m-%d_%H%M).tgz
cd /home/mynuc/docker/openhab4.1.1
tar cfz $file .

I got it running the same way on my machine where I mounted a Synology shared folder.
I see just a few differences:
In NFS permission settings change Squash to none
Allow non-privileged ports

However, I habe no experience with docker. Maybe something is blocking full communication with Synology? Maybe also add both IP addresses to your Synology (in case your container has a different IP address than your NUC).

When you mount -a your folder, are there any error messages inmthe log? journalctl -r

What is your maximum nfs protocol version and did you enable Standard Unix Permissions under advanced settings on your Synology?

Thanks for your effort.

This is on both sites not running in a docker. Only Openhab is running in a docker and files are outside the docker

4

Below the response.
mount -a /nfs/backup_nuc doesn´t generate a entry

feb 13 11:24:57 mynuc-desktop polkitd[684]: Unregistered Authentication Agent for unix-process:3977:49367 (system bus name :1.104, object path /org/freedesktop/PolicyKit1/Aut>
feb 13 11:24:56 mynuc-desktop systemd[1]: Reloading finished in 832 ms.
feb 13 11:24:56 mynuc-desktop systemd[1]: Reloading...
feb 13 11:24:56 mynuc-desktop systemd[1]: Reloading requested from client PID 3977 ('systemctl') (unit user@1000.service)...
feb 13 11:24:56 mynuc-desktop polkitd[684]: Operator of unix-session:1 successfully authenticated as unix-user:mynuc to gain TEMPORARY authorization for action org.freedeskto>
feb 13 11:24:48 mynuc-desktop polkitd[684]: Identity `unix-group:admin' is not valid, ignoring: No UNIX group with name admin: Success
feb 13 11:24:48 mynuc-desktop polkitd[684]: Registered Authentication Agent for unix-process:3977:49367 (system bus name :1.104 [/usr/bin/pkttyagent --notify-fd 5 --fallback]>

What very strange is that touch delete.me is still working but get errors when I run the script. This was working before.

Thanks for your support. I will try another time a different implementation.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.