NFS shares fail to mount from Ubuntu server [UPDATE]

I have googled pretty much everything related to NFS shares. The service is up and running, the shares are exported (verified via showmount -e), and unless I’m completely mistaken in how the exports should be addressed, the shares are exported to the proper IP addresses.

Here’s my /etc/exports file:

/export/home_shared 192.168.1.1/255.255.255.0(rw,sync,insecure) 192.168.1.3(rw,no_root_squash)
/export/xen_vhd 192.168.1.1/29(rw,sync,insecure) 192.168.1.2(rw,no_root_squash)

It’s my understanding the IP/netmask filters allowed clients, and as far as I know the combination should allow home_shared to be accessible from all clients in the 192.168.1.* range, and the xen_vhd share should be accessible from all clients in the 192.168.1.[1-7] range.

From my Ubuntu 14.04 server (IP 192.168.1.3), I can’t mount the share home_shared with the error:

mount.nfs: access denied by server while mounting 192.168.1.25:/export/home_shared.

However, from my XenServer (192.168.1.2) I was able to mount the xen_vhd share and have complete access.

I don’t know if this in an Ubuntu issue or Rockstor issue. Both Xen and Ubuntu are using NFSv4.

Been banging my head against this one for days. Any suggestions?

TIA,
Josh

EDIT: Apparently I can’t edit my own posts, so I’m replying instead. Here’s an update for anyone interested.

I was able to get Ubuntu to attach an NFS share R/W using the ‘-o vers=3’ option. However, this isn’t really desirable, as security in vers3 leaves much to be desired. So I kept trying other things.

It turns out, Rockstor uses NFSv4 by default, but fails to export a root directory.

Adding the line:

/export 192.168.1.0/24(rw,fsid=0,no_subtree_check,sync)

fixed the problem. Any client in the subnet can access the /export/home_shared directory by using:

sudo mount -t nfs 192.168.1.25:/home_shared /mnt

Note with NFSv4 you don’t explicitly specify the root (fsid=0) directory. Creating files and folders result in uid=nobody and gid=nogroup, which is correct for v4 while using root credentials (required for mounting without fstab user entry).

This issue appears to be solved. I changed the tag to [UPDATE] to see if anyone has anything to suggest in the event I missed anything I could have done different. Or to suggest adding NFS shares via Rockstor web interface add the fsid=0 export and change the tooltip to reflect NFSv4 conventions.

2 Likes