LXC bind mount of NFS folder: "Stale file handle"

Ciige

New Member
Aug 26, 2025
1
0
1
Hi everybody,

I've been trying (and failing) to make my NAS accessible to my media server LXC (unprivileged). I configured all the necessary permissions on my NAS (OS openmediavault), mounted it to my PVE host via fstab, full access. But bind mounting it to the LXC is where everything breaks down: the mounted folder shows up, but when i try to access the folder in any way (cding into it, accessing subfolders or creating files) all I get returned is: ...: Stale file handle

Apparently this means that the filepath is no longer correct? (file moved, folder deleted, etc)

But I am still able to access it from the PVE host shell.

I've consulted multiple threads on how to do bind mounts correctly, each messing with UIDs/GIDs in their own way (which i franly don't understand ^^*), followed steps in the Proxmox wiki article on this topic. Any help would be appreciated.
 
Found your thread while trying to find the cause for this myself.

This could have multiple causes, but in my case using TrueNAS, I had maproot set to the user I want, not mapall. So the user (/their mapped ID) within the LXC had no permissions to access the mounted folder.

I changed from maproot to mapall on the NFS share (on TrueNAS), so that any user would be mapped to the (TrueNAS) user who has sufficient permissions on the dataset.

I'm sure you could also fix this by using lxc.idmap and the other stuff in the wiki, but having to do all that just to get an NFS mounted directory working inside an unpriviledged LXC is not very straightforward IMHO, I prefer to avoid messing with proxmox files manually in the CLI whenever I can.

Either way, you want to make sure that the user ID of the user within your LXC matches the user ID on your NAS for whoever can access the dataset.