NFS client doesn't mount or mounts slow on startup on 11.10

Bug #891825 reported by enedene
64
This bug affects 11 people
Affects Status Importance Assigned to Milestone
nfs-utils (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Here is the problem. I have a ubuntu server 10.04 and installed nfs-server.
Every client I had till 11.10, would mount the folders at startup. Here is my fstab on Ubuntu 11.10 client:

ubuntuserver:/media/huge /media/huge nfs rsize=16384,wsize=16384,rw,auto,nolock
ubuntuserver:/media/externi-disk /media/externi-disk nfs rsize=16384,wsize=16384,rw,auto,nolock

I have to wait for a minute till these directories get mounted. I have not changed any setup on 10.04 server, the previous 11.04 mounted the disks out of the box.
The problem is that I have lot of setup files on my server, for example I have a link to pidgin, thunderbird etc. and on startup these programs can't get to their data. Network rises up fast on startup so that shouldn't be a problem.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/891825/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
enedene (enedene) wrote :

I'm not sure if this is the package that poses the error, it could be some boot script that starts too late. I don't know how to make a better report.

affects: ubuntu → nfs-utils (Ubuntu)
Revision history for this message
Steve Langasek (vorlon) wrote :

Thanks, nfs-utils is probably a good place to start with this bug.

When you say you have to wait for a minute for these directories to be mounted, where exactly does it "wait"? Are you left at the initial Ubuntu splash screen waiting for them to be mounted? If so, is there a message on the screen at the time? Or do you mean that the system starts up and you're able to log in, but the mounts aren't available for another minute?

Changed in nfs-utils (Ubuntu):
status: New → Incomplete
Revision history for this message
enedene (enedene) wrote :

@Steve Langasek
It makes no difference, if I log in immediately drives are not available for a minute or so. If I wait at login window and then log in, files are available.
I have a fast computer and haven't had these problems till this version.

Revision history for this message
Steve Langasek (vorlon) wrote :

It is by design that the system does not wait for NFS mount points outside the FHS directories before starting the desktop; you can override this behavior by including the 'bootwait' option in the fstab for these mounts.

Otherwise, I think this most probably points to improvements to the desktop startup time on your system rather than a regression in nfs-utils. If you think there is a regression here, you could try running mountall with the --verbose option in /etc/init/mountall.conf and capture the output to a log file, to see if something else is happening, but I think this is probably not a bug.

Changed in nfs-utils (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
wowo (woutvanvucht) wrote :

Maybe the next thing could be helpful.: I have a NAS-server (nfs3 !) and I mount on my Ubuntu desktops several shares.

On Ubunt 10.10 this shares where mounted instantly at booting.

Now I am using Ubuntu 11.10 I must wait 1 minute till the mounts are up.
The solution for me was ad the following line to fstab:
nfsvers=3

Could this be an explanation ??????:
Ubuntu 11.10 tries to make by default a nfs4 mount. If the server has also a nfs4 structure this would not be a problem.
But is the server has nfs3 the mounting succeed only after a while.

Revision history for this message
enedene (enedene) wrote :

@Steve Langasek
It's not the boot speed, this version doesn't boot any faster. I've added 'bootwait' option and the loading screen was there for a minute or two longer and when it finally mounted the drives I could login.
It must be something during the boot process that slows this down, it may not be the nfs-utils, but I have no idea how should I know what it is.
"If you think there is a regression here, you could try running mountall with the --verbose option in /etc/init/mountall.conf and capture the output to a log file"
I have no idea how to implement this and how to get that log output.

Revision history for this message
enedene (enedene) wrote :

@Wout van Vucht
my server runs nfs4 so that shouldn't be the problem.

Revision history for this message
wowo (woutvanvucht) wrote :

Linux manual:
"To mount an export using NFS version 2, use the nfs file system type and specify the nfsvers=2 mount option. To mount using NFS version 3, use the nfs file system type and specify the nfsvers=3 mount option. To mount using NFS version 4, use either the nfs file system type, with the nfsvers=4 mount option, or the nfs4 file system type."

Maybe you should give a try to add nfsvers=4 to your fstab.
For instance:
ubuntuserver:/media/huge /media/huge nfs rsize=16384,wsize=16384,rw,nfsvers=4,auto,nolock
or something like this.

Revision history for this message
enedene (enedene) wrote :

@Wout van Vucht sorry, but I was wrong, I also have NFS3 share, adding nfsvers=3 fixes things. Thank you.

Revision history for this message
Steve Langasek (vorlon) wrote :

If specifying the NFS version fixes the delay, it seems likely that there's a firewall blocking the NFSv4 port. So since the behavior change in the protocols attempted is deliberate, this still appears to not be a bug.

Revision history for this message
enedene (enedene) wrote :

Nope, as you can see from the exports file:
"# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/media/huge 192.168.0.2(rw,sync,no_subtree_check,no_root_squash)
"
I use NFS3 not NFS4. On LAN I have no firewall, communication is free between hosts.

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 891825] Re: NFS client doesn't mount or mounts slow on startup on 11.10

The point is that when you haven't specified the protocol version, nfs4 will be tried first; and this should never be slow unless there's some kind of firewall in effect.

enedene <email address hidden> wrote:

>Nope, as you can see from the exports file:
>"# Example for NFSv2 and NFSv3:
># /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
>#
># Example for NFSv4:
># /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
># /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
>#
>/media/huge 192.168.0.2(rw,sync,no_subtree_check,no_root_squash)
>"
>I use NFS3 not NFS4. On LAN I have no firewall, communication is free between hosts.
>
>--
>You received this bug notification because you are subscribed to nfs-
>utils in Ubuntu.
>https://bugs.launchpad.net/bugs/891825
>
>Title:
> NFS client doesn't mount or mounts slow on startup on 11.10
>
>To manage notifications about this bug go to:
>https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/891825/+subscriptions

Revision history for this message
wowo (woutvanvucht) wrote :

I have an QNAP TS-239 Pro II with the NFS-server and it has an NFS Access Control (some sort of firewall ??)
Network Share Name:xxxxxxx
Access Right: no limit
Allowed IP Address or Domain Name: xxxxxxxxx

On the server side (QNAP TS-239 Pro II) nothing was changed.
The only change was the change from Ubuntu 10.10 to Ubuntu 11.10.

When I use the same fstab Ubuntu 11.10 as in Ubuntu 10.10 there will be an delay of almost 1 minute to mount the shares.
When I add nfsvers=3, the mounting is direct at booting time as it was in Ubuntu 10.10.

Examples:
192.168.1.130:/pictures /media/NAS-pictures nfs ro,hard,intr 0 0
This share is mounting in Ubuntu 11.10 after 1 minute

192.168.1.130:/pictures /media/NAS-pictures nfs ro,nfsvers=3,hard,intr 0 0
This share is mounting in Ubuntu 11.10 direct at booting.

So I think it has nothing to do with an firewall.
There is some change in handling of nfs shares in Ubuntu 11.10.

Revision history for this message
enedene (enedene) wrote :

First of all its NFS3 for sure, if I put nfsvers=4 parameter and try to mount -a I get:

mount.nfs: mounting ubuntuserver:/media/huge failed, reason given by server:
  No such file or directory
mount.nfs: mounting ubuntuserver:/media/externi-disk failed, reason given by server:
  No such file or directory

It's not firewall.
Mine server is on 192.168.0.1, and client is 192.168.0.2.
Here is an ufw rule:
sudo ufw status:
...

To Action From
-- ------ ----
Anywhere ALLOW 192.168.0.2

Next I did a zenmap port scan, from client to server, here you are:

PORT STATE SERVICE VERSION
21/tcp open ftp vsftpd 2.2.2
22/tcp open ssh OpenSSH 5.3p1 Debian 3ubuntu7 (protocol 2.0)
| ssh-hostkey: blabla (DSA)
|_2048 blabla (RSA)
80/tcp open http Apache httpd 2.2.14 ((Ubuntu))
|_html-title: Site doesn't have a title (text/html).
111/tcp open rpcbind
| rpcinfo:
| 100000 2 111/udp rpcbind
| 100003 2,3,4 2049/udp nfs
| 100021 1,3,4 33800/udp nlockmgr
| 100005 1,2,3 50000/udp mountd
| 100024 1 50001/udp status
| 100000 2 111/tcp rpcbind
| 100003 2,3,4 2049/tcp nfs
| 100021 1,3,4 38914/tcp nlockmgr
| 100005 1,2,3 50000/tcp mountd
|_100024 1 50001/tcp status
2049/tcp open rpcbind
3128/tcp open http-proxy Squid webproxy 3.0.STABLE19
| http-open-proxy: Potentially OPEN proxy.
|_Methods supported: GET HEAD
3389/tcp open microsoft-rdp VirtualBox VM Remote Desktop Service
3390/tcp open microsoft-rdp VirtualBox VM Remote Desktop Service
8000/tcp open ssl/http TwistedWeb httpd 8.1.0 (Twisted 9.0.0)
|_html-title: Sign in -- Sage
9091/tcp open http Transmission BitTorrent management httpd (unauthorized)
|_html-title: Site doesn't have a title (text/html; charset=ISO-8859-1).
| http-auth: HTTP Service requires authentication
|_ Auth type: Basic, realm = Transmission
50000/tcp open rpcbind
50001/tcp open rpcbind

As you can see everything is open, ports 50000 and 50001 on server are the ones for NFS.
I've also added on server hosts.allow: ALL: 192.168.0.2, and on client ALL: 192.168.0.1

On every other version of ubuntu this worked fine, and I haven't been changing any configuration on server.

Revision history for this message
Steve Langasek (vorlon) wrote :

> First of all its NFS3 for sure, if I put nfsvers=4 parameter and try to mount -a I get:

> mount.nfs: mounting ubuntuserver:/media/huge failed, reason given by server:
> No such file or directory

Ok, and this happens immediately, there's no delay? That's a good indicator that it's not a firewall problem, yes; instead it seems to be a startup-specific problem. There may be a race condition where, if the mount is attempted before the network is up, it results in a delay.

Is downgrading the nfs-common package on the client to the 11.04 version enough to resolve this issue?

Changed in nfs-utils (Ubuntu):
status: Invalid → Incomplete
Revision history for this message
enedene (enedene) wrote :

@Steve Langasek yes, it happens immediately, there is no delay for error when doing the "mount -a".
What fixes the problem is as Wout van Vucht said, adding nfsvers=3 to fstab. Then it does load at startup, so it shouldn't be a networking problem, network is up on time.
Is trying to downgrade the package to 11.04 really necessary? I've had Ubuntu 11.04 installed till few weeks ago and had no problems with that version.

Revision history for this message
Robert Maynord (r58eft) wrote :

I have this exact same problem. I have been experimenting with solutions for about a month now, with no success. Here are a few thoughts...

_11.10 clients on a 11.04 server running nfs4 DO have the problem. (11.04 clients are OK).
_I built a 11.10 server running nfs4 as a test. The problem persists.
_Clients on 11.10 nfs4 systems will NOT boot if nfsvers=3 is inserted into the fstab.
_As a test, I shut down my LAN firewall. No change.
_bootwait in fstab helps the boot problem, but introduces another problem: if more than one client tries to boot at the same time they both freeze.

If adding nfsvers=3 to fstab solves the problem, then wouldn't it be logical to assume there is a bug with NFS4? The question would then be: is it an Ubuntu problem, or a NFS problem? In other words, would a different distro behave the same?

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 891825] Re: NFS client doesn't mount or mounts slow on startup on 11.10

On Fri, Nov 25, 2011 at 09:53:45AM -0000, enedene wrote:
> Is trying to downgrade the package to 11.04 really necessary? I've had
> Ubuntu 11.04 installed till few weeks ago and had no problems with that
> version.

Yes, because it could be any of a number of related packages causing this
problem, and we need to see whether downgrading *just* the nfs-common
package is sufficient to resolve it.

At this stage, it would also be useful to know if this bug is reproducible
with 12.04 beta 1.

Revision history for this message
Martin Hansson (martin-75) wrote :

Just had this problem in Ubuntu 12.04. Setting nfsvers=3 in fstab solved this for me.

As enedene I thought I was using NFS 4 until I saw the /etc/exports file comments and realised I also use NFS3
Both the server and the client are running Ubuntu 12.04.
(They were installed as 12.04 beta 2 but are now updated to 12.04)

Revision history for this message
Dr. Clue (drclue) wrote :

It turned out (here at least) that adding the "nfsvers=3" parameter in the etc/fstab for the nfs mounts
restored the connectivity.

Prior to the upgrade to 12.04 the nfsvers parameter had not been needed, but
with the upgrade , the nfsversion parameter seems to make all the difference.

--Doc

Revision history for this message
Lem (lem-jjr) wrote :

I said this bug affects me also, but I've been doing some testing with Ubuntu 12.04 and pinpointed MPD (Music Player Daemon) as the issue. I have my music share on a remote system (NFS over LAN), but regardless of that, simply installing mpd (no NFS enabled) added 30 seconds to my boot time in 12.04. Bootchart shows a long period of inactivity (disk and CPU). So, in my case, the slow boot is actually mpd related, not NFS.

Revision history for this message
archer123 (archer123) wrote :

I have just upgraded from 10.03 client to 12.04. I access a QNAP TS110 NAS using NFS. I had the same symptoms as described above, i.e. slow mounting of nfs drives after logon which was not present on 10.04. The problem was resolved by using nfsvers=3 in fstab.

The previous post written by Lem indicates that mpd may be the problem. However on my system mpd is not installed so cannot be the primary cause of the problem.

Revision history for this message
wowo (woutvanvucht) wrote :

From Linux manual: Options for NFS versions 2 and 3 only.
nfsvers=n:
If this option is not specified, the client negotiates a suitable version with the server, trying version 4 first, version 3 second, and version 2 last.
On 10.10 (and earlier) I had no problems.
In 11.10 and 12.04 I had to add nfs=3 for instant contact with my QNAP NAS.

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

[Expired for nfs-utils (Ubuntu) because there has been no activity for 60 days.]

Changed in nfs-utils (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Antti Miranto (software-antti) wrote :

wowo, I believe that "From Linux manual: Options for NFS versions 2 and 3 only. nfsvers=n:" isn't unambiguous at least for me it worked like this. With nfsvers=4 exactly same problems come up as with nfs4. Setting this nfsvers=3 resolves it but downgrades protocol to nfs3.

I remember beating my head to wall last time with this in Maverick. Finally got time to upgrade :-)

I got it resolved with these options:
server:/mnt/mythtv-00 /mnt/mythtv-00 nfs4 defaults,nfsvers=4,relatime,timeo=100,ac,bg,clientaddr=192.168.1.20 0 0
Direct copy of my client's fstab. I believe its bg or timeo=100 option which made it to work. Don't have time to experiment but passing info here.

But this is pain as Ubuntu still don't work with basic things like nfs... I'd like to see slowdown in releases or omit one release to really fix these annoying things.

Revision history for this message
Steve Langasek (vorlon) wrote :

Slowing the pace of Ubuntu releases would have no bearing on NFS support. Many Ubuntu developers are *already* using NFS on Ubuntu, both client and server, without any issues. If NFS isn't working for you, the first step is to file a cogent bug report with enough details to let the developers reproduce the problem.

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.