Friday, September 29, 2017

lock/nolock option for NFS mount option

lock/nolock option for NFS Share

I have explored internet for detailed information on nolock NFS mount option, there are very limited details are available. I have tried to consolidate all the details in this single page as below.

This option to enable whether to use NLM sideband protocol to lock files on the server. If neither option is specified(or if lock is specified), NLM locking is used for this mount point. When using nolock option, application can lock files, but such locks provide exclusion against other applications running on the same client. Remote applications are not affected by these locks. In other words when nolock option is used. This prevents the exchange of lock information between the NFS server and this client. The server is not aware of file locks on the client, and vice versa.

The failure to maintain proper locking between a write operation on one host and a read operation on another host may reader to get incomplete or inconsistent date.

Mount option for any share can be updated without really impacting the application. However, for this option, as this is going to change the behavior of locking mechanism for a mount and at the same if the mount is being  used as an application file system(such as weblogic domain) which is usually are  actively used, its always recommended to do it with a proper downtime, means bring down the application and perform the activity.