Hi all! I’ve moved Nextcloud and Immich data folders from local to a NFS folder. Everything is fine except when snapraid runs on the NFS server. Structure:
- Proxmox host that also act as a NFS server
- NFS exported folders are in a MergerFS folder (BRTFS) that are part of snapraid (2 data drives and 1 parity drives)
- A Proxmox VM with all the Docker containers
- Inside the VM I’ve mounted the NFS shares that are always available (even after the backup)
In the containers the folders are bind mounted like this /mnt/nfs/nextcloud/data:/var/www/html/data
After the backup the NFS share are still available in the VM, but if I enter the container I get:
root@nextcloud-app:/var/www/html# ls -latr data
ls: cannot access 'data': Stale file handle
The NFS are mounted like this:
172.5.0.5:/mnt/pool/@nextcloud /mnt/nfs/nextcloud nfs vers=4,rw,hard,intr,timeo=600,retrans=10,_netdev,nofail,x-systemd.requires=network-online.target 0 0
How can I solve this problem?
I have found docker hates locally mounted NFS mounts direct to volume mounts. its kind of like symlinking a symlink of a symlink.
best way I have found that this works is to use CIFS and declare a NAS share to an actual docker volume and then mount that inside the container like any other volume.
personally I would have preferred NFS, but here we are.
it has something to do with how NFS connectivity maintains a connection. it’s not “always on” but is inefficient when it quickly needs to reconnect for a read/write request. or at least something like that.
There’s an official doc about this: https://trapexit.github.io/mergerfs/latest/remote_filesystems/
Have you tried those things?
You need to set the
fsidfort your export entry in the NFS server since they are all on the same actual mountpoint.What have you tried?
Nothing man, and he’s all out of ideas!
@remindme@mstdn.social 2 days
I don’t have a good answer but I’m super curious about this.
You say the mount is still fine from the VM, so it must be something with how the docker mounts are configured.
In the early days of docker there used to be a tool that used rsync to sync changes between host and container filesystems when such support wasn’t yet available on some systems (like Mac). I’m wondering if something similar is needed here. Or some additional options in your docker mount mappings.

