Linux – CentOS 7 NFS partition doesn’t mount on boot

centosfstablinuxnfs

I have a CentOS 7 x64 server which doesn't mount NFS entries in /etc/fstab on boot. The configuration is correct, because if I run mount -a, everything works like a charm. The fstab entries are as such.

10.0.0.61:/vault/enterprise     /usr/www/vault  nfs     rw      0       0
10.0.0.61:/vault/files          /usr/www/files  nfs     rw      0       0
10.0.0.61:/vault/data           /usr/data       nfs     rw      0       0

Originally I was a freebsd admin. I had no trouble getting the shares to work, but I'm not understanding why they don't work on boot. Could iDRAC on the server be interfering? Does the VIP I have on loopback have anything to do with it? I'm at a total loss.

Best Answer

You need to be using _netdev in your mount options. This will cause the mount to happen AFTER netwokring finishes initializing, rather than potentially before (as with local disks).

Also, seriously look at using autofs to mount NFS and other network based filesystems. It behaves much better and needs much less attention than using the fstab to mount volumes that are more dynamic in nature (and volumes that are subject to periodic disconnection). Specifically, autofs will mount a given volume upon access, rather than at boot. It will also remount it automatically in case fo failure.