Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to get a basic nfs4 working between two machines (let's call them server and client). I have followed this manual by letter to no avail. Here's what I'm getting:

root@server#: tail -n 2 /etc/exports
/export client-ip/24(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
/export/users client-ip/24(rw,nohide,insecure,no_subtree_check,async,no_root_squash)

root@server#: showmount --exports
Export list for server-ip:
/export/users client-ip/24
/export       client-ip/24

Server side seems to be OK. Directories exist, their permissions are granted (775). Addresses (client-ip and server-ip) are numeric - replaced with acronyms here for obvious reasons. Next, the client:

root@client#: mount -v -t nfs4 server-ip:/export /opt/nfstest
mount.nfs4: timeout set for Thu Apr 14 15:52:31 2011
mount.nfs4: text-based options: 'clientaddr=client-ip,addr=server-ip'
mount.nsf4: mount(2): No such file or directory
mount.nfs4: mounting server-ip:/export failed, reason given by server:
   No such file or directory

It just doesn't accept the remote folder. Apart from one above, I tried server-ip:/export/users, server-ip:/ - getting same result. Client does have access to server:

root@client#: telnet server-ip 2049
Trying server-ip...
Connected to server-ip.
Escape character is '^]'.

root@client#: showmount -e server-ip
Export list for server-ip:
/export/users client-ip/24
/export       client-ip/24

Local directory /opt/nfstest exists. Module nfs is loaded on the nfs client. There are no firewall between the server and client. What else should I check?

Additional information: Ubuntu Lucid (10.04.2), running on Amazon ec2 box. NFS versions (nfs-common, nfs-kernel-server) are 1:1.2.0-4ubuntu4.1.

share|improve this question
    
What happens if you get rid of the explicit type in your mount line (mount -v server-ip:/export /opt/nfstest)? –  jwernerny Apr 15 '11 at 14:37
    
It was hanging and eventually timing out, IIRC. Can't check this right now as I have modified the server side's /etc/default/nfs-common to have NEED_IDMAPD=no from =yes (which probably downgraded nfs to v3). Can't change this back right now as the share is in active use - needed to get things working. –  mindas Apr 15 '11 at 14:48

1 Answer 1

up vote 5 down vote accepted

The value 0 has a special meaning when use with NFSv4. NFSv4 has a concept of a root of the overall exported filesystem. The export point exported with fsid=0 will be used as this root.

Therefore include fsid=0 into /etc/exports and then do the following:

mount -t nfs4 <serverip>:/ /localmount/point

and not

mount -t nfs4 <serverip>:/exports /localmount/point

That's it.

share|improve this answer
    
Does this work for anyone? It still gives the same error for me. –  puk Nov 15 '13 at 9:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.