Stale file handle on NFS mount


Recommended Posts

Setup:
UNRAID v.6.8.3

Ubuntu 20.04 client (Pop!OS variant)

Fixed IP on client and server side

NFS share option 192.168.2.10(sec=sys,rw) - this is the IP of the client computer

client's /etc/fstab entry:
192.168.2.17:/mnt/user/MULTIMEDIAS      /home/normand/NFS/NORMAND-NAS-01/MULTIMEDIAS    nfs     defaults,timeo=14,soft 0 0
 

Issue:
It happens with all my shares. I use them, then, at any given (and random) times, I have a "Stale file handle" message and I have to remount the drive to continue working with it. The weirdest part, is that sometimes, a program or process is still writing to the share with no issue but I can't make anything else communicate with it (file manager, other programs). I wait until the process finishes and unmount/remount the drive to continue working...
Is it due to the mounting options I used on the client's side? I am not understanding these NFS parameters well, even after 10 years of linux usage! :P

Link to comment
  • 3 weeks later...
  • 8 months later...

Same for me, running UNRAID 6.9.0 and Ubuntu 20.04 in a VM.

I've mounted an UNRAID NFS export in the Ubuntu VM using the /etc/fstab file and the following configuration:

10.10.xxx.yyy:/mnt/user/share /mnt/share nfs rw 0 0

 

Randomly after some time (sometimes after minutes or sometimes after hours) the NFS export is not accessible anymore. When I try to view the mounted content by typing "ls /mnt/share", I get the following error: "ls: cannot access '/mnt/share': Stale file handle"

 

Already disabled "Tunable (support Hard Links)" in "Global Share Settings". Also disabled caching for this particular share where I have got the issue.

 

Anyone find a solution or workaround for this issue already?

Link to comment
  • 2 years later...
On 3/5/2021 at 3:32 PM, Charly said:

Same for me, running UNRAID 6.9.0 and Ubuntu 20.04 in a VM.

I've mounted an UNRAID NFS export in the Ubuntu VM using the /etc/fstab file and the following configuration:

10.10.xxx.yyy:/mnt/user/share /mnt/share nfs rw 0 0

 

Randomly after some time (sometimes after minutes or sometimes after hours) the NFS export is not accessible anymore. When I try to view the mounted content by typing "ls /mnt/share", I get the following error: "ls: cannot access '/mnt/share': Stale file handle"

 

Already disabled "Tunable (support Hard Links)" in "Global Share Settings". Also disabled caching for this particular share where I have got the issue.

 

Anyone find a solution or workaround for this issue already?

I'm having this exact same issue as well with 6.11.5.

Link to comment

Same recurring issue with 6.11.5 as well. What are the correct NFS export/mount parameters to avoid this issue?
I have a Synology NAS as well with NFS exports and have never run into this issue. Occurs every day, several times a day with UNRAID.

Edited by Econaut
Link to comment
On 5/25/2023 at 6:35 PM, dlandon said:

Make sure you are using NFSv4.


How do we make sure that it's using NFSv4?
Even though I enabled it in /etc/nfsmount.conf, if looking at the version with "nfsstat -m" it says "vers=3" on Unraid.

Link to comment
1 minute ago, GnaXi said:


How do we make sure that it's using NFSv4?
Even though I enabled it in /etc/nfsmount.conf, if looking at the version with "nfsstat -m" it says "vers=3" on Unraid.

How are you mounting them?  You need to do the following:

  • Use Unraid 6.10 or later for NFSv4 support.
  • Specify NFSv4 in your mount command.  -t 'nfs4'
Link to comment
9 minutes ago, dlandon said:

How are you mounting them?  You need to do the following:

  • Use Unraid 6.10 or later for NFSv4 support.
  • Specify NFSv4 in your mount command.  -t 'nfs4'

I'm mounting a share from Unraid from my virtual Ubuntu.
Even if I use -t nfs4, so that my virtual Ubuntu uses nfsv4, Unraid still insists on using v3.

Link to comment

You're mounting this share on the Unraid server using NFSv3:

May 28 13:34:24 GnaXServer unassigned.devices: Mounting Remote Share '192.168.2.130:/volume1/Andi'...
May 28 13:34:24 GnaXServer unassigned.devices: Mount NFS command: /sbin/mount -t 'nfs' -o rw,noacl '192.168.2.130:/volume1/Andi' '/mnt/remotes/Jabba'
May 28 13:34:24 GnaXServer  nfsrahead[4700]: setting /mnt/remotes/Jabba readahead to 128
May 28 13:34:24 GnaXServer unassigned.devices: Successfully mounted '192.168.2.130:/volume1/Andi' on '/mnt/remotes/Jabba'.

 

You can mount this using MFSv4 by a setting in UD.

Screenshot 2023-05-28 120129.png

 

This is a client mount setting used when mounting NFS shares with UD.

 

NFSv3 is known to have stale file issues with Unraid because of the Mover moving files from a cache to the array.  Several attempts at work arounds are only partially effective.  NTFSv4 is the best solution

Link to comment
24 minutes ago, dlandon said:

You're mounting this share on the Unraid server using NFSv3:

May 28 13:34:24 GnaXServer unassigned.devices: Mounting Remote Share '192.168.2.130:/volume1/Andi'...
May 28 13:34:24 GnaXServer unassigned.devices: Mount NFS command: /sbin/mount -t 'nfs' -o rw,noacl '192.168.2.130:/volume1/Andi' '/mnt/remotes/Jabba'
May 28 13:34:24 GnaXServer  nfsrahead[4700]: setting /mnt/remotes/Jabba readahead to 128
May 28 13:34:24 GnaXServer unassigned.devices: Successfully mounted '192.168.2.130:/volume1/Andi' on '/mnt/remotes/Jabba'.

 

You can mount this using MFSv4 by a setting in UD.

Screenshot 2023-05-28 120129.png

 

This is a client mount setting used when mounting NFS shares with UD.

 

NFSv3 is known to have stale file issues with Unraid because of the Mover moving files from a cache to the array.  Several attempts at work arounds are only partially effective.  NTFSv4 is the best solution

Thanks! Where is that setting located though? Feels like I've looked everywhere at this point :P

Link to comment
32 minutes ago, dlandon said:

UD Settings.

I see! But I'm not using UD for the setup that I'm having issues with.
The NFS share that you referred to earlier is working fine, when Unraid is connecting to a share on a different server.
Issue is the other way around, when a different server is connecting to a share on the Unraid server.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.