In this article, we will look what is the meaning of hard and soft mount in NFS and which option we should use ?
To understand this lets understand the terms one by one.
1. Hard Mount
Hard mount NFS partition is repeatedly queried by the client if a server is not reachable and will write the changes as soon as the server is reachable.
It will not timeout ideally if NFS server is unreachable which sometimes affects its performance.
To kill the repeated NFS server call, it is recommended to use intr option to interrupt the repeated server call.
2. Soft Mount
In soft mount, the client sends the request to server and if the server is offline, it immediately responds back with error and hence it does not impact the performance of NFS client.
3. Hard Mount vs soft Mount: Which should i use ?
On desktop systems, we prefer to use soft mount so that the server keeps running without any impact on performance.
However on servers, if you mount the partition using soft mount, it can lead to data loss since there are multiple servers accessing the partition, and it could simply return timeout if connection fails.
Hence we recommend to use hard mount on the client, wit intr option so that a client can interrupt in case server is not reachable for a very long time.
It makes sure the no data is lost even if the server is not reachable for some time.
4. Recommended way of using soft or hard mount ?
### Soft Mount: we used to mention retries value to 5, as sometimes it can timeout. $ mount -o soft,retry=5 18.104.22.168:/usr/nglinux /nglinux ### Hard Mount: mentioning intr is essential to kill the process in case server has some major issue. $ mount -o hard,intr 22.214.171.124:/usr/nglinux /nglinux