Sometimes fails to mount nfs directories

Bug #30241 reported by Crispin Flowerday
40
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
Fix Released
High
Scott James Remnant (Canonical)

Bug Description

My network card dhcp's to get it's IP address, and then I mount a few directories (via fstab) from nfs. This includes /home. Sometimes the nfs mounting fails leaving me unable to login via gdm. My fstab contains:

server:/home /home nfs rsize=8192,wsize=8192 0 0
server:/data /data nfs rsize=8192,wsize=8192 0 0

and /etc/network/interfaces contains:

# The primary network interface
iface eth0 inet dhcp
auto eth0

Revision history for this message
Michael R. Head (burner) wrote :

Confirmed.

I'm seeing this, too. Running the latest dapper.

I don't know if the nfs mounting should be done in a script in /etc/network/ifup.d or if the nfs mount should wait for a non-lo network interface to come up...

Matt Zimmerman (mdz)
Changed in netbase:
assignee: nobody → keybuk
status: Unconfirmed → Confirmed
Revision history for this message
Matt Zimmerman (mdz) wrote :

Indeed, it seems to me that we ought to try mounting 'auto' entries after bringing up a network interface

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Yeah, the trouble there is when you have /usr on an NFS-mounted directory ... you need to mount them in the main sequence

And the trouble with that is that there's no way to tell whether a network interface actually came up; ifup still registers "up" if DHCP fails.

Revision history for this message
Crispin Flowerday (crispin-flowerday-deactivatedaccount) wrote :

Scott, I still get the problem, and /usr isn't nfs mounted, and DHCP _always_ works for me, at least when the nfs dirs aren't mounted I have just had to go to a terminal and mount them manually, I haven't had to raise eth0.

Revision history for this message
Fabio Massimo Di Nitto (fabbione) wrote :

I have the same problem here but i noticed that it happens only when booting into newly installed kernels (for example on ABI bumps). If i run depmod -a with the new running kernel and i reboot, the problem goes away forever.

I *think* that with all the attempts to improve the boot speed we managed to endup in never running depmod -a at least once on a kernel boot to refresh everything. Another side effect of this is that things like alsa index= options are not respected at the first boot without depmod -a.

Probably the best solution would be to make sure that we run depmod -a at least once. on boot, into a new installed kernel, before everything else happen.

Fabio

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

I don't see what depmod has to do with it, except that it would increase the time between S10udev (when the network interface is brought up) and S45mountnfs.sh (when the mount is mounted), and thus bias the race.

We don't ever run depmod -a in the boot process, we run it in the kernel's postinst. There is no need to "refresh" anything. I've never heard of index= options, what are they?

Running depmod is not a solution, we need to load modules before we have a writable root filesystem; and this caused all sorts of problems.

The solution is simply to run mountnfs.sh in a network if-up.d script.

Revision history for this message
Michael R. Head (burner) wrote :

Scott, what about the problem of the NFS-mounted /usr? Won't there will still be a race between services controlled by sysvinit living under /usr and the network?

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Like I say above, that is a problem and I haven't decided on a solution yet -- which is why this bug isn't fixed.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

 sysvinit (2.86.ds1-6ubuntu27) dapper; urgency=low
 .
   * Move the mountnfs.sh init script to a network if-up.d script, and
     clean up a little now it's not being run in the main boot sequence.
   * Place a simple waitnfs.sh init script in its place that waits for
     /usr to be mounted if necessary.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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