2

I have one server A that is configured to auto-mount an NFS path from server B, using the following entry in /etc/fstab:

serverB:/data/media/serverA  /data/media             nfs     defaults        0 0

During long power outages (and yes, I have a UPS good for about 30 minutes) or power cycles where both machines are rebooted at around the same time, I've noticed that this path is sometimes not auto-mounted in the case when serverA boots up while serverB is still offline.

I've written a simple script to manually run on serverA after serverB is online, that will fix the mount, but is there a better way to do this? I feel like some process should automatically be able to handle this scenario without some custom hack from me.

Does the entry in /etc/fstab not handle this case, or have I misconfigured it?

3 Answers 3

4

I'd probably change the 'default' to something like 'soft,intr,rw,bg'. The bg is especially important as it says if the mount fails, retry it in the background for (pretty large number) of times until the it gets mounted.

2
  • What system do you use those on? I've checked the man page for mount on Fedora and Ubuntu, and neither list "soft", "intr", or "bg" options.
    – Cerin
    Nov 8, 2011 at 14:57
  • On fedora (as per the man page), check out nfs(5)
    – mdpc
    Nov 8, 2011 at 16:58
4

man mount and take a look at the _netdev option. You probably should use it to delay mounting until the network has been started:

serverB:/data/media/serverA  /data/media    nfs    _netdev,rw,...    0 0
0

This is a case where I would look at something like autofs or another auto-mounter. Using this tools file-systems are mounted on demand, not at boot time. A failure because the server is not available at boot time is then temporary. When you to access the mount-point after the server after it is ready, the file system will get mounted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .