Solved NFSv4 mount from 9.3-RELEASE-p49 server times out

Esteemed Colleagues:

An NFS mount from my 9.3-RELEASE-p49 server, on which Port 2049 has been opened, hangs, and then times out, unsuccessfully. This is the /etc/exports file:

Code:
V4: /home/jay/.elm
/home/jay/.elm -ro -mapall=nobody

When the V4 line is commented out, the mount fails immediately, indicating that port 2049 is indeed open. Moreover, when the V4 line is changed, and /home/jay/.elm is replaced by / (i.e., the root directory), the mount succeeds immediately. But then the client can mount anything, so that is, of course, an unacceptable solution; I want the client to be able to mount only the /home/jay/.elm directory (apparently the 2nd line is ignored for NFSv4 mounts, because when the first line is the root directory, the client can mount anything). When the client is localhost, then the mount succeeds immediately, but that is probably because it is downgrading to NFSv3 and accessing mountd and nfsd as RPC services, which is, of course, impossible when the server is firewalled, because you cannot know what ports to open.

Please resist the temptation to give me the facile answer "don't run 9.3-RELEASE on your server" and to say nothing more; upgrading the server is not an option at present. Also, I am, of course, cycling all daemons whenever I change /etc/exports, so you need not tell me to do that. Also, there are no symbolic links leading up to /home/jay/.elm, so you need not tell me to check for that.

Thank you in advance for any and all replies.

jay at m5 dot chicago dot il dot us
 
It makes no difference. The mount times out (unless the client is localhost) regardless of whether the V4: line is line 1 or line 2.
 
nfsv4(4):
Code:
CLIENT MOUNTS
     To    do an NFSv4 mount, specify the ``nfsv4'' option    on the mount_nfs(8)
     command line.  This will force use    of the client that supports NFSv4 plus
     set ``tcp'' and NFSv4.

I suspect that the nfs mount command syntax you are using is incorrect. How do you try to mount the exported remote mount point? The usual way ( rhost:path node ) as in the following example maybe?:

mount -o nfsv4 x.x.x.x:/home/jay/.elm /mnt

If it's so, the manual of nfsv4(4) states:
Code:
                                                                  ....  Since
     the NFSv4 file system is rooted at    ``<rootdir>'', setting this to any-
     thing other than ``/'' will result    in clients being required to use dif-
     ferent mount paths    for NFSv4 than for NFS Version 2 or 3.

You have set the <rootdir> to V4: /home/jay/.elm, that means the client must use a different mount path then specified, actually only one option as mount path is possible. Try the following syntax:

mount -o nfsv4 x.x.x.x:/ /mnt

That will mount .elm as the root directory to /mnt.
 
Changing the mounted directory to / was exactly what I needed to do. Everything now works perfectly, and I shall mark the topic as solved; thank you.

The mounts were formerly failing because I was trying to mount /home/jay/.elm/home/jay/.elm, which does not exist. What threw me off, was that the mounts were timing out, instead of failing immediately because the client was asking to mount a nonexistent directory. I realize now -- it's obvious once you realize it -- that the mounts were timing out because the NFSv4 mount was failing immediately, and then the client was attempting an NFSv3 mount, which timed out because the client received no response from port 111 on the server. When the client was localhost, the NFSv4 mount failed immediately and then the NFSv3 mount succeeded immediately, because localhost has access to all the local ports.
 
Back
Top