Server Fault is a question and answer site for system and network administrators. 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

The automatic NFS mount at boot doesn't work. This is my fstab row:

nas:/backups     /mnt/nas_backups      nfs     rw,_netdev,auto    0       0

Using mount -a it works, but at boot it doesn't work. After some investigations, I think the problem lies in /etc/network/run/ifstate: I say this because /etc/init.d/ calls /etc/network/if-up.d/mountnfs, which contains this code:

exit_unless_last_interface() {
    grep "^[:space:]*auto" /etc/network/interfaces  | \
   sed -e 's/[ \t]*auto[ \t]*//;s/[ \t]*$//;s/[ \t]/\n/g' | \
   while read i; do
   if [ `grep -c $i /etc/network/run/ifstate` -eq "0" ]; then
       msg="if-up.d/mountnfs[$IFACE]: waiting for interface $i before doing NFS mounts"
       log_warning_msg "$msg"
       # Can not pass this as a variable because of the while subshell
       mkdir /var/run/network/mountnfs_earlyexit 2> /dev/null
    if [ -d /var/run/network/mountnfs_earlyexit ]; then
   rmdir /var/run/network/mountnfs_earlyexit 2>/dev/null
   exit 0

This code makes the script exit, because in /etc/network/run/ifstate there is not the eth0 interface (its only content is lo=lo), although eth0 interface is up and running.

Do you have some suggestions about the causes ifstate is not correct, and how to resolve this?

UPDATE 1: This is the configuration of eth0 (an user said it could take a part in the problem, so I write it):

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
 # The primary network interface
auto eth0
iface eth0 inet static
         post-up iptables-restore < /etc/iptables.up.rules

UPDATE 2: This is the output of /etc/init.d/networking restart:

Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning).
Reconfiguring network interfaces...SIOCADDRT: File exists
Failed to bring up eth0.

After the restart eth0 works correctly, and /etc/network/run/ifstate still doesn't contain eth0.

share|improve this question
Is your eth0 up? – InternetSeriousBusiness Jul 31 '12 at 15:10
yes it is, it works flawlessy :/ – ProGNOMmers Jul 31 '12 at 15:11
Can you edit your /etc/network/if-up.d/mountnfs and replace /bin/sh with /bin/bash -x, run /etc/init.d/ manually and report back? – InternetSeriousBusiness Jul 31 '12 at 15:17
no need to modify it, just run bash -x /etc/network/if-up.d/mountnfs... done, this is the result: PS I didn't know this bash option :) – ProGNOMmers Jul 31 '12 at 16:09
The problem lies indeed in /etc/network/run/ifstate. Is is writable? What does /etc/init.d/network restart tell you? – InternetSeriousBusiness Jul 31 '12 at 16:41
up vote 1 down vote accepted

It was a problem of missing firmware: the network card (a NetXen NX3031) works without installing his proprietary firmware, but works better with it (firmware-netxen package inside non-free repos).

Once installed, at the reboot the network devices has been mounted correctly. Thank you a lot!

share|improve this answer

Maybe adding the "bg" option into your fstab mount line might get around this?

If the bg option is specified, a timeout or failure causes the mount(8) command to fork a >child which continues to attempt to mount the export. The parent immediately returns with a >zero exit code. This is known as a "background" mount.

share|improve this answer
I tried, no luck. This was predictable, since the mount in itself works without problems, and the network works flawlessly too. The problem is that the mountnfs init service doesn't try at all to mount the network devices, because it does not find eth0 inside /etc/network/run/ifstate. – ProGNOMmers Aug 1 '12 at 9:47
missing firmware problem. Thank you for your answer – ProGNOMmers Aug 1 '12 at 10:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.