Linux – NFS mount drops to read-only during intermittent network failure

linuxnfsrhel5

I have an NFS mount (say to /opt/foo) on a RHEL5 install that occasionally drops to a read-only filesystem after a short network failure…I have control over this box but not over the network, so I can't fix the thing causing these network drops.

I'd like to be able to get back to a writable file system without having to unmount and remount this NFS, is there a way to do that?

Alternatively, is there a way to make it so that when the network comes back the NFS comes back as writable?

Best Answer

You will want to look into hard vs. soft mounts and increase your timeout values.

Check mount options. http://docstore.mik.ua/orelly/networking_2ndEd/nfs/ch06_03.htm

NFS partitions can be mounted in one of two ways, hard or soft.

HARD MOUNTS are permanent mounts designed to look just like any normal, local file system. If a partition that is hard mounted becomes unavailable, client programs will keep trying to access it forever. This will cause local processes to lock when a hard mounted disk goes away. Hard mounts are the default type of mount.

SOFT MOUNTS will fail after a few retries if a remote partition becomes unavailable. This is a problem if you are writing to the partition, because you can never be sure that a write will actually get processed on the other hand, your local processes will not lock up if that partition does go away. In general, soft mounts should only be used if you are solely reading from a disk and even then it should be understood that the mount is an unreliable one. If you soft mount a partition that will be written to, you are nearly guaranteeing that you will have problems.

Related Topic