0

I am using NFS to share some important directories (/home, /opt, /local/usr) from a machine to other machines (all OS are Debian 9). Most of the time it works well. However, when the server's network fails, The client machines will have problems of starting up or logging in since these directories cannot be mounted.

I hope to keep these sharings because together with NIS it does make things much easier, and most of the time it does work well. I would like to ask solutions in occasional cases of server network failure. For example, is it possible to set up this way: in case the server is inaccessible online (so the remote NFS directories cannot be mounted in clients), the client can switch automatically to use the local directories to avoid startup or login failure.

1

I think you are looking for below options.

_netdev : The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the net‐              work has been enabled on the system).
nofail : Do not report errors for this device if it does not exist.
0

You should use the bg (background) option in the NFS entries in your /etc/fstab. That way, the system won't block during boot until it is able to mount the filesystem, but won't give up on trying to mount it either.

Refer to the nfs(5) manpage in Linux and mount_nfs(8) on BSD for more details.

0

If they are important directories, consider offering them from two (synchronised) servers and using the automounter to select one depending on availability or preference. If one goes down the other can take up the load.

See man 5 autofs

Replicated Server

A mount location can specify multiple hosts for a location, portentially with a different export path for the same file system. Historically these different locations are read-only and provide the same replicated file system.

Multiple replicated hosts, same path:

<path> host1,host2,hostn:/path/path

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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