0

I have an ubuntu system which I'm controlling with commands as a regular user over ssh. On that machine I have an fstab entry for an NFS share. I can mount and unmount the folder because I have the user option set in the fstab entry.

The problem is that the NFS SERVER is shutdown nightly (not going to change) resulting in a Stale file handle error on the client.

As a sudo user I could simply force an umount/mount for the NFS share but this isnt possible as I'm controlling the machine as a regular user over ssh and I dont intent to pipe the password.

So the question is: How, as a regular user, can I unmount/remount or otherwise fix my Stale file handle fault?

2

There are a couple ways to resolve this, but none are optimal. Ideally you'd want to unmount the share before the NFS server goes down (which could be done with something like an SNMP trap or custom socket program, or any number of other methods).

I think in this case, my preferred action would be to cron the unmounting, assuming the NFS server is shut down and booted around the same time frame every day. If the NFS server goes down sporadically, I'd instead look into using SNMP traps or informs. (A writeup on them is available here.)

  • So I guess "Dont let it get stale" is key and "You WILL require super user permissions if you need to unmount a stale share". It still seems strange and a shame to me that a user can unmount a share but not if its stale - as though the failure of the nfs server reduces the rights of the regular user. – Mr Purple Sep 16 '15 at 22:57
  • NFS has historically not been very resilient to interruption, and a stale file handle isn't a "normal scenario" that should ever occur (of course it occurs all the time). It's definitely a balance between (lack of) stability and convenience. Sorry there isn't a better solution. :) – Tim S. Sep 17 '15 at 0:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.