How to Fix ‘Stale File Handle’ Error on NFS Mount?

0
2
Asked By CuriousDolphin42 On

I'm dealing with an NFS issue on my Ubuntu 22.04 server (NFS version 2.6.1) after accidentally disconnecting the eSAS cable from my external disk storage (it's Dell hardware). After the disconnection, I unmounted the NFS on all clients (which are also Ubuntu 22.04 on Dell hardware) and rebooted the NFS server. Now, while some clients can mount successfully, others are giving me a 'mount.nfs: Stale file handle' error. I've already tried rebooting the problematic clients but the issue persists. What other steps can I take to resolve this? Just to note, the server's exports are set up as follows: /var/nfs/backups 10.221.128.0/24(rw,sync,all_squash,no_subtree_check) and on the clients, my fstab entry is: nfs-server:/var/nfs/backups/ /mnt/backups nfs auto,nofail,noatime,nolock,intr,tcp 0 0.

3 Answers

Answered By CodeCrafter22 On

You might want to force unmount the problematic clients using `umount -fl /mountpoint` and then try `mount -a`. Just a heads up, it may be tricky since you can’t mount the filesystem if it’s already problematic.

Answered By TechyTurtle99 On

A possible solution is to re-export the NFS shares on your server. You can do this by running `exportfs -ua` followed by `exportfs -a`. This may actually clear up the stale handles. It’s also worth noting that using `exportfs -rav` is often a good way to refresh NFS exports, but I’ve found re-exporting can sometimes make a difference. Give it a shot!

Answered By GizmoGuru56 On

Make sure to check the journal logs for the NFS services on both the server and clients using `journalctl`. If there are any specific errors or issues showing up, that could point you to the problem.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.