Examples of Hard Installation and Soft Installation in NFS

Using the NFS protocol, the NFS client can mount the existing file system on the NFS server, just like the local file system.

NFS mount can be used as soft mount Either hard mount. These installation options define how the NFS client should handle NFS server crashes or failures.

In this tutorial, we will see the difference between soft installation and hard installation in NFS.

1) Soft installation

Assuming you have mounted the NFS file system using the following command soft mount. When a program or application requests a file from the NFS file system, the NFS client daemon will try to retrieve the data from the NFS server. However, if the NFS server does not receive any response (due to a crash or failure of the NFS server), the NFS client will report an error to the process on the client computer requesting file access.

The advantage of this mechanism is that the response speed is fast, because it does not wait for the NFS server to respond. But the main disadvantage of this method is data corruption or data loss. Therefore, it is not recommended to use this option when data integrity is critical.

$ sudo mount -o rw,soft host.nf_server.com/share_name /mnt/nfs_data

2) Hard installation

If you have mounted the NFS file system using the following command hard mount, It will repeatedly try to contact the server. After the server is back online, the program will continue to execute without being affected by the state when the server crashed. We can use the mount option’intr’, which allows interrupting NFS requests when the server is down or inaccessible. Therefore, the recommended setting is to be used with the intr option.

$ sudo mount -o rw,hard,intr host.nf_server.com/share_name /mnt/nfs_data

On newer versions of Linux, intr This option has been hard-coded into the kernel (after kernel 2.6.25), so it has been disabled. Therefore, you must use kill -9 to stop the NFS process.

in conclusion

For critical applications that cannot withstand any data corruption, the recommended option is to use hard loading.

In this tutorial, we discussed the difference between the soft install option and the hard install option on NFS installation.

Please also read:

  • How to force unmount NFS mounted directory
  • Find detailed NFS mount options in Linux
Sidebar