# NFS mounts 'hang' after resume

## Cyberwizzard

When suspending my machine, 2 NFS mounts are still active. When the machine wakes up again, the mount points hang and so do the application which had file handles to the mount points.

I tried writing a script to umount before suspending and invoking a mount when the machine came back up but it looks like the script is run before networking is restored (I've tried with NetworkManager and the normal gentoo scripts) so the mount points remain empty.

I was hoping the network auto-mounting would take care of the NFS mount in this situations but it looks like it does not.

Do I have something configured wrong or does NFS not like to be interrupted...

----------

## Cyberwizzard

I tried various mount options, which did not help at all.

Then I noticed I was using NFSv3 as I followed a guide which advocated the use of NFSv3 as it was supposed to be much more stable and fast than its successor. After finding out how I should upgrade to NFSv4 (by creating the virtual pseudo root and exporting that instead of separate folders on the host) I now have NFS sharing using NFSv4. While I didn't run any performance benchmark, Amarok is pulling 4.5 MB/s through its scanner on one of the shares now so I'm not too worried about performance.

I tried suspending twice now and both times the NFS mounts were fully functional after the resume. I hope this solved my problem - if it keeps working (the old situation magically resumed correctly every now and then, probably due to my resume/remount script) I'll mark this thread as solved.

As an observation though: if NFSv3 is actually pretty useless on systems which hibernate/suspend, why can't I find information online?

----------

## Hu

I suspend and resume systems acting as both NFSv3 clients and NFSv3 servers somewhat regularly.  The only problem I have ever seen is the obvious one that accessing a mount point while the server that supplies it is hibernating will stall until the server resumes.  I have never seen a mount become stuck in the manner you describe.

Am I correct that, upon resume, the server should be reachable via normal IP mechanisms?  If you were using a laptop and resuming somewhere else, it might not be, in which case failure is expected.

----------

## Cyberwizzard

 *Hu wrote:*   

> I suspend and resume systems acting as both NFSv3 clients and NFSv3 servers somewhat regularly.  The only problem I have ever seen is the obvious one that accessing a mount point while the server that supplies it is hibernating will stall until the server resumes.  I have never seen a mount become stuck in the manner you describe.
> 
> Am I correct that, upon resume, the server should be reachable via normal IP mechanisms?  If you were using a laptop and resuming somewhere else, it might not be, in which case failure is expected.

 

Indeed, both server and client are normal computers, connected by wired ehernet and the client contacts the server using its ip address.

Last night I suspended my computer using 'pm-suspend' and its still working when it got back up.

----------

