NFS mounts often missing after reboot

Bug #46145 reported by Pieter Nagel
This bug report is a duplicate of:  Bug #46516: NFSv4 mounts often missing after boot. Edit Remove
8
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: initscripts

With initscripts-2.86.ds1-6ubuntu31 from ubuntu, I find that some or all NFS mounts from /etc/fstab are missing, after about 50% of all reboots. I saw this with an fstab with both NFSv3 and NFSv4 mounts, as well as with only an NFSv3 mount.

By "missing" I mean that the directory is not reported when running "mount". Weirdly, however, the actual remote files *are* often, but not always, visible to ls etc, even though the mount is not listed. This "weird case" seems to happen to NFSv3 mounts only.

This sounds like a combination of two bugs: NFS exports are sometimes not mounted, and mount sometimes does not update mtab even when the directories are mounted.

When there are mounts missing, executing "sudo mount -a" usually fixes it, as one would expect.

Sometimes, however, "sudo mount -a" prints the error "mount: <server>:<mountpoint> already mounted or <mountpoint> busy" - in the above-mentioned weird case when ls lists the mount's files even though the mount is not listed. However, even *this* is not deterministic, because "mount -a" sometimes succeeds without error even in the weird case.

As a wild guess, this bug might be related to the following behaviour: when executing the following all as one command:

umount -a -t nfs,nfs4; \
/etc/init.d/networking stop; \
rmmod tg3; \
/etc/init.d/udev restart; \
/etc/init.d/networking start; \
ifconfig eth0; mount -t nfs,nfs4; \
sleep 3s; \
ifconfig eth0; mount -t nfs,nfs4

At the time of the first ifconfig, eth0 has obtained no IP from DHCP yet and no nfs mounts are listed. The DHCP request seems to happen in the background. After the 3s sleep, eth0 has an IP and mounts *are* listed. This means that there is a window during which scripts such as /etc/network/if-up.d/mountnfs which iterate over the output of "mount" might be confused.

The "rmmod tg3" is intended to emulate boot-time behaviour when the network module is not yet loaded. Without it, everything works. It's as if the tg3 module is not immediately "ready" after having been insmodded, which forces dhclient to obtain the DHCP IP in the background, which delays the execution of /etc/network/if-up.d/mountnfs, which confuses something in the boot-up process.

Related branches

Revision history for this message
DaveQB (david-dward) wrote :

I have the same problem here after doing a dist-upgrade to Dapper from Breezy. fstab hasn't changed and was working fine in Breezy last night.

I have only rebooted 3 times and all times NFS mounts weren't mounted but could be (I use Kwidisk).

I will do some more investigating with thise info at hand.
I have previously been digging around in my rc folders to see if NFS mounts are attemtped to be mounted BEFORE the network is brought up. So far no luck as I am no expert on RC scripts.

Revision history for this message
DexterF (dexter-filmore) wrote : Same here

Two client machines here, one upgraded from 6.06-6.10-7.04, one fresh 7.04 installation, server is Slackware 11.0, NFSv3, other distros work just fine.
My suggestion how to solve this for the moment: provide a submount/subfs package, so submoutn handles NFS. I used this for years and it worked fine since it issues a mount command on access.
(Tried compiling it myself, wouldn't work, gcc4 issues I guess)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sysvinit - 2.86.ds1-14.1ubuntu37

---------------
sysvinit (2.86.ds1-14.1ubuntu37) hardy; urgency=low

  * debian/initscripts/etc/init.d/mtab.sh:
    Explicitly add mtab entries for networked file systems; race condition
    exists where mtab can get overwritten *after* networked file systems are
    mounted (LP: #46145, #44836).
  * debian/initscripts/etc/init.d/waitnfs.sh, debian/control:
    Update inline documentation, as waitnfs ONLY waits on /usr and /var mounted
    filesystems.
    Before waiting for net file systems, try mounting them (with watershed)
    just in case the mount has not been attempted elsewhere.
    Added udev as dependency due to use of watershed.
  * debian/initscripts/etc/network/if-up.d/mountnfs:
    Remove the bulk of this script to a common library script
    Call the common library script with watershed for locking purposes
    (LP: #45842, #46516).
  * debian/initscripts/lib/init/mountall-net-fs, debian/rules:
    Common library script for mounting all network file systems (nfs, cifs,
    samba, etc).
    Script can be called in various meaningful locations; should be wrapped
    with watershed to correctly handle race conditions.

 -- Dustin Kirkland <email address hidden> Tue, 26 Feb 2008 16:10:56 -0600

Changed in sysvinit:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.