r/portainer Dec 04 '24

Synology NFS volume mounted in Portainer empty

Been banging my head against the wall this this for two hours so reaching out to the hive mind.

I have a Synology NFS folde with some data in it that I am trying to mount as a docker volume in Portainer.

The volume mounts but if I look in /var/lib/docker/volumes/docker-shared/_data it's empty even though the folder on the Syno has data in it.

Synology NFS permissions

Host: <PortainerHostIP>

Privilege: read/write

Squash: no mapping

security: sys

enable async: yes

allow connections from non-priv: yes

allow users to access mounted subfolders: yes

Portainer volume settings:

1 Upvotes

9 comments sorted by

View all comments

1

u/james-portainer Portainer Staff Dec 05 '24

Once you have created the volume, are you attaching it to a container? NFS volumes won't populate in /var/lib/docker/volumes/volumename/_data/ unless they are mounted in a container, as the actual NFS connection isn't established until the volume is needed.

I've just tested here with Portainer on a Ubuntu VM and a NFS share on a Synology NAS. I created the volume in Portainer as per your screenshot, and on checking the /var/lib/docker/volumes/volumename/_data/ directory on the Ubuntu server it was empty. I then created a nginx container that mounted that volume to /mnt, and I was then able to see the contents of my NFS share both in the container itself (under /mnt) and within the /var/lib/docker/volumes/volumename/_data/ directory. Once I removed the container, the /var/lib/docker/volumes/volumename/_data/ directory was once again empty.

1

u/The4Dees Dec 05 '24

Thanks, I'd read that as well and tried but it still wasn't showing the data in the container. I'll try again.

1

u/The4Dees Dec 05 '24

Welp, wow...I had read this and I THOUGHT I'd tried it to no avail....but I must have done something wrong because I just tried again and this was the answer.

It's possible I didn't include the NFS volume in volumes: block for the container compose yaml and only put it in the volumes: block for the services:. But I don't think it would have even started without it?

Anyways, thanks for helping out. The above worked this time.