Linux – Failure to automatically mount a NFS area consistently after a reboot

fstablinuxnfs

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?

Best Answer

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.