You are not logged in.

#1 2020-01-09 08:10:46

From: Scotland
Registered: 2007-11-12
Posts: 40

[Solved]Perstent "Stale file handle" error when mounting new NFS share

Hi all

I'm trying to set up a little file server and I've run into a problem. I've created a brand new NFS share, but the client can't mount it, I keep getting a "Stale file handle" error.

The server is a rock64 arm board, the client is a normal PC, both running arch. The 4 physical drives hosting the share are mounted in a 4 bay caddy and connected via USB3, they are formatted (partitionless) as a btrfs raid 10 array. A single subvolume has been added for the share, here's the fstab line that mounts it on the server...

/dev/sda	/srv/nfs/netshare	btrfs	defaults,auto,rw,nodev,noexec,nosuid,autodefrag,subvol=netshare	0 0

User credentials are synchronized with LDAP. Time is synchronized using htpdate. Yes, I know that's weird, but both server and client machines are syncing time from web server on the same LAN, so it's accurate enough. Trying to access the share using nfs locally on the server fails with the same error, so it's not a networking or time sync issue.

Everything I've found when searching for answers says that remounting the share should fix this, but it doesn't. Reformatting the underlying array didn't help either. Everything has been undone/redone at least once and nothing works. Does anyone here have any ideas?

Update: I just plugged a USB memory stick in and it shares over NFS just fine. I suspect it's a btrfs/NFS compatibility thing, but both are widespread enough that I'd expect to have found someone with similar issues when I was searching for solutions. Weird.

Solution: I found this on the Gentoo forums. The solution is to mount the btrfs array elsewhere, bind mount it into the NFS root, and to use the fsid option when specifying it as an export. The value of the fsid option isn't important, it just needs to be unique. It's now working, yay! big_smile

So my fstab contains these lines...

/dev/sda	/mnt/netshare	btrfs	defaults,auto,noatime,rw,nodev,noexec,nosuid,autodefrag,subvol=@netshare	0 0
/mnt/netshare	/srv/nfs/netshare	none	bind	0 0

And my /etc/exports.d/netshare.exports file looks like this...


Last edited by Klepto (2020-01-09 09:13:57)

I'm a moderate, it's the mainstream that's extremist.


Board footer

Powered by FluxBB