I have a few servers running CentOS 5.3, and am trying to get 2 NFS mount-points to mount automatically on boot. I added 2 lines similar to the following to fstab:

server1:/path1                /path1           nfs     soft            0 0
server2:/path2                /path2           nfs     soft            0 0

When I run 'mount -a' manually, the mount points are properly mounted as expected. However, when I reboot the machine, only /path2 is mounted. For /path1 I get the following error:

mount: can't get address for server1

It obviously looks like a DNS issue, but the record is properly configured in all the DNS servers and is mounted properly if I re-try the mount after the reboot is completed. I could properly fix this by using IP address instead of hostnames in /etc/fstab or adding server1 to /etc/hosts but I would rather not do that.

What might be the reason for failing to resolve this specific address during boot time? Why the problem is only with the 1st mount point and the 2nd is properly mounted despite having identical configuration?


had the same issue, on CentOS 5.3, i did

1) enable STP portfast on the switch (cisco)

spanning-tree portfast default 

2) changed the nfs mount in fstab to

server:/dir   /dir   nfs   _netdev,rw,bg,hard,intr   0  0

and now it works just fine.


How does your machine get its DNS configuration?

  • are you using DHCP ?
  • are you allowing enough time for the LAN interface to come up before starting the NFS mounts?

The latter problem can be caused, for exmaple, by ethernet switch ports that don't come live instantly when they detect a client coming online.

  • Static IP configuration, no DHCP. The DNS servers are set statically in /etc/resolv.conf. When booting, it says: Bringing up interface eth0 [OK] Much before the mount error, so I assume the network is functional at that time. – sagi Sep 21 '09 at 11:07
  • how much before? I've seen switch ports that take 30s to start forwarding traffic. – Alnitak Sep 21 '09 at 11:19
  • 2
    The 30 second delay is Spanning Tree doing loop detection. STP on most of the switches I've used will time out after 30 seconds if no STP speaker is detected by the switch. You can disable STP on a per-port basis on most managed switches. On Cisco IOS, you would do "spanning-tree portfast", which will cause the port to become immediately available. – James Sneeringer Sep 21 '09 at 13:43
  • @James - yes, that's the one. I couldn't remember what the setting was called. – Alnitak Sep 22 '09 at 8:55

Add the bg in the option part.

server1:/path1 /path1 nfs bg,soft 0 0

This puts the mounting in background modus. Once the server is available the mount will be available.

Good luck.

This does not solve the DNS problem, but it solves the mounting problem :-)

  • Tried, it made no difference.. I am not sure that it works with the soft mode. – sagi Sep 21 '09 at 9:35

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.