[Bug 836533] Re: Still problems with nfs-mounts in /etc/fstab on boot

Alatariel 836533 at bugs.launchpad.net
Mon Aug 29 09:25:40 UTC 2011


The nfs-upstart-fixer, as posted by Hans Höök

---
A FIX for the problem
=============

We have also noticed that for some hosts, more often with multiple cpu
cores in our experience, NFS shares are not mounted in time during
upstart.

We have tried NFS v3 and v4 with Ubuntu 8.04 servers and Ubuntu 10.04
clients.

If /home is an NFS share this will cause a lot of trouble since a login without a home catalog will result in a locked up gnome session that requires sudo rights and some command line skills to resolve.
(Not the kind of situation you would like your users to find themselves in...)

It is a shame that this problem still persists – we have suffered from
its consequences since 10.04 was released and not been able to find its
root cause. To help others in the same condition we have decided to
publish our fix – even thought it is quite ugly it works and removes the
symptoms.

(Most likely the problem is related to DHCP assigned network interfaces
not being up when mountall expects them to. This will cause a time out
condition that is only resolved after a considerable amount of time and
sometimes not at all, I.e the NFS shares remain unmounted when the user
logs in.)

The following fix will provide peace of mind and happy users:

1. In /etc/fstab make sure all NFS mounts have the flag “noauto” set like:
10.0.0.250:/home /home nfs4 noauto 0 0

2. Add the attached upstart script /etc/init/nfs-upstart-fixer.
If you use NFS v4, that uses idmapd, uncomment:
'start on (net-device-up and started idmapd)
'
If you use NFS v3, that does not depend on idmapd, uncomment:
'start on (net-device-up)
'

3. Add the attached script /sbin/ensure-nfsshares-mounted.

4. Above will take care of most situations but if you are using gdm and are quick when logging in there is still a chance that the home share may not be mounted.
To be sure add the following line to the script /etc/gdm/PostLogin/Default:
/sbin/ensure-nfsshares-mounted

This will act as a guard.
(Read instructions in /etc/gdm/PostLogin/Default.sample if ther is no /etc/gdm/PostLogin/Default
in your system.)

Note 1:
The “magic” time constant of 8 seconds /etc/init/nfs-upstart-fixer is empiric. It works on all hosts I have seen this far. If it is too small there will be a time out condition which will cause the time between entering password and until the login is completed by quite a long time.
If this happens try with 10, 12, 14 until this does not happen.

Note 2:
For non gdm users there is probably a “hook” corresponding to /etc/gdm/PostLogin/Default.

Note 3.
If you have NFS shares in /etc/fstab that are truly intended to be “noauto” the above solution will
have to be modified a bit.

Hope you may now also enjoy swift boot up and NFS mounted home shares in
Ubuntu even though this embarrassing bug remains unfixed!

Best regards
---


** Attachment added: "nfs-upstart-fixer"
   https://bugs.launchpad.net/ubuntu/+source/mountall/+bug/836533/+attachment/2329127/+files/nfs-upstart-fixer

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to mountall in Ubuntu.
https://bugs.launchpad.net/bugs/836533

Title:
  Still problems with nfs-mounts in /etc/fstab on boot

Status in “mountall” package in Ubuntu:
  New

Bug description:
  https://bugs.launchpad.net/debian/+source/sysvinit/+bug/275451
  specifically: https://bugs.launchpad.net/debian/+source/sysvinit/+bug/275451/comments/62 

  We still have the same problem with /home not mounting on start since it's nfs-mounted and thus we can't login without our fix. 
  Link to the fix: https://bugs.launchpad.net/debian/+source/sysvinit/+bug/275451/comments/66

  DISTRIB_ID=Ubuntu
  DISTRIB_RELEASE=10.04
  DISTRIB_CODENAME=lucid
  DISTRIB_DESCRIPTION="Ubuntu 10.04.3 LTS"

  
  ii  mountall                                    2.15.3                                           filesystem mounting tool

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mountall/+bug/836533/+subscriptions




More information about the foundations-bugs mailing list