Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem with automatically mounting nfs shares on my debian server.

The server structure is a bit complicated. I have got a mac mini server with mac os x 10.7 and I am runnning Debian squeez on a Oracle VirtualBox 4.1.12 VM. Now the idea is to mount 2 directorys from the mac as nfs shares.

The mac config /etc/exports

/ws_home -maproot=root ip.from.the.debian
/ws_data -maproot=root ip.from.the.debian

The /etc/fstab from the debian server

ip.from.the.mac:/ws_data /data nfs rw,hard,intr,async,nodev,nosuid 0 0
ip.from.the.mac:/ws_home /home nfs rw,hard,intr,async,nodev,nosuid 0 0

Now when I mount -a it works perfectly but on reboot the shares are not automatically mounted and I don't understand why or what I have to do to get it auto mounted.

I also tryed to add a auto flag to the fstab

ip.from.the.mac:/ws_data /data nfs rw,hard,intr,async,nodev,nosuid,auto 0 0

but that did not change anything

share|improve this question

migrated from May 16 '12 at 12:31

This question came from our site for professional and enthusiast programmers.

Probably at the boot time, when trying to mount this drive, the network is not initialzed yet, so it can't find your mac address (which you should be able to check in your logs, dmesg or /var/log/messages). You may solve this by using a script running at boot time, using rc.local or similar. – hornetbzz Apr 26 '12 at 11:57

As suggested by @hornetbss, you probably need to delay the mounting of the nfs shares until network is up. You should be able to achieve this by adding _netdev as an option to the shares.

ip.from.the.mac:/ws_data /data nfs _netdev,rw,hard,intr,async,nodev,nosuid 0 0

There are also options fg and bg for re-trying the mounting (in foreground or background), if the first time fails.

Other possibility would be using autofs, which automatically mounts the drive when it is accessed.

share|improve this answer

You must log in to answer this question.