Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to create a script that runs on the client and checks my NFS mount periodically and changes some stuff around (moves a read-only, local version of the data in place of NFS) if there is an issue. Right now the script attempts to load a file on the NFS mount, which more or less works, except it takes 5 minutes to time out when there is an issue. Is there a way to set the timeout of a file request? Or another way to quickly test if my NFS mount is working? Even better would be a way to have NFS unmount itself if the connection gets dropped.

Thanks

share|improve this question
    
How are you mounting NFS and what NFS version are you using? –  jeffatrackaid Jan 3 '12 at 21:48
add comment

1 Answer

There are hard and soft mounts that have different behaviors when network connectivity is lost.

hard or soft — Specifies whether the program using a file via an NFS connection should stop and wait (hard) for the server to come back online, if the host serving the exported file system is unavailable, or if it should report an error (soft).

You may want to review the NFS mount options and see which best fit your needs. Intr is another one to check.

http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-nfs-client-config-options.html

NFS Monitoring

In terms of checking NFS mounts, why re-invent the wheel. I would take a look at some nagios plugins to start:

http://exchange.nagios.org/directory/Plugins/System-Metrics/File-System/NFS

Perhaps you can modify those to meet your needs.

In our practice, we often monitor NFS indirectly. We monitor the applications that depend on an NFS mount. If the app fails, our response procedures include checking NFS. We could monitor NFS directly but we see NFS failures very rarely.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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