Home

NFS: stale file handle in contaniers after snapraid sync

$$12277
https://lemmy.ml/u/peregus posted on Mar 15, 2026 10:45

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

How can I solve this problem?

https://lemmy.ml/post/44522042
Reply
$$12283
https://programming.dev/u/mspencer712 posted on Mar 15, 2026 11:15
In reply to: https://lemmy.ml/post/44522042

What have you tried?

https://programming.dev/comment/22731460
Reply
$$12295
https://lemmy.zip/u/jaybone posted on Mar 15, 2026 12:02
In reply to: https://lemmy.ml/post/44522042

@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.

https://lemmy.zip/comment/25266088
Reply
$$12351
https://lemmy.ca/u/psycotica0 posted on Mar 15, 2026 13:45
In reply to: https://lemmy.ml/post/44522042

There’s an official doc about this: https://trapexit.github.io/mergerfs/latest/remote_filesystems/

Have you tried those things?

https://lemmy.ca/comment/22223381
Reply
$$12353
https://sh.itjust.works/u/wildbus8979 posted on Mar 15, 2026 13:51
In reply to: https://lemmy.ml/post/44522042

You need to set the fsid fort your export entry in the NFS server since they are all on the same actual mountpoint.

https://sh.itjust.works/comment/24301875
Reply
$$12367
https://lemmy.dbzer0.com/u/ExcessShiv posted on Mar 15, 2026 14:38
In reply to: https://programming.dev/comment/22731460

Nothing man, and he’s all out of ideas!

https://lemmy.dbzer0.com/comment/24967746
Reply
$$12379
https://piefed.world/u/zoroa posted on Mar 15, 2026 15:15
In reply to: https://lemmy.ca/comment/22223381

I had the same issue with mergerfs + nfs, and fixed by following the official doc here

https://piefed.world/comment/4305836
Reply
$$12412
https://lemmy.world/u/GreenKnight23 posted on Mar 15, 2026 16:26
In reply to: https://lemmy.ml/post/44522042

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.

https://lemmy.world/comment/22676885
Reply
$$12724
https://sopuli.xyz/u/lnxtx posted on Mar 15, 2026 23:04
In reply to: https://lemmy.ml/post/44522042

I’m not a fan of the kernel NFS server implementation.

I have less headaches when I switched to NFS-Ganesha.

https://sopuli.xyz/comment/22447940
Reply
$$13432
https://lemmy.ml/u/peregus posted on Mar 17, 2026 06:40
In reply to: https://lemmy.ca/comment/22223381

Sorry, I’ve missed all the notifications. Thanks a lot, I’ll have a look straight away!

https://lemmy.ml/comment/24586514
Reply