Root NFS Share not accessible by clients

As of 3.8-14.09 the root nfs share /exports is not listed in the exports file. This results is access being denied on the ubuntu and centos hosts I tried mounting it on. This line allows root access so that subdirs can be accessed

/export 192.168.1.0/24(rw,fsid=0,no_subtree_check,sync)
#Root IP/SUBNET(ARGS)

As a temp fix in my case I added it to ‘/exports.d/root.exports’ that way the file is persistent and isn’t overwritten every time I reboot of modify my NFS shares. Is this a bug in this version or some sort of feature I don’t understand?

Hello Dylan,

As far as I know, each NFS share is only exported separately like so in /etc/exports, depending on your settings:

/export/foo  192.168.1.0/24(r[w], [a]sync, insecure)

This is just the same way as the other types of shares are handled. However, you can add your own lines to /etc/exports by using “Advanced Edit” in the NFS export view; these will be persistent.

sfranzen, thank you for the quick reply! You are correct on all counts but unfortunately those are not the issue. If /exports/files is shared but not /exports then the server will refuse access to clients based on the fact that they don’t have access within the root /exports location. At that point in the servers programming it doesn’t matter how many shares you set up (manually or not). Also if I tried to add that line through the web-ui it throws an error based on the fact that ‘exports’ is not a share, which is indeed true.

I’ve had to implement this root share before on my current Ubuntu NAS for my NFS shares to correctly allow access.

Hmm, then I’m not yet sure what the issue is. How do your clients access the shares? I personally mount shares with something like mount rockstor:/export/foo /mnt/bar and this hasn’t given me any problems.

1 Like

Most of my servers are unmanaged (unless something goes wrong) and just simply offer their services. As such these mounts are in the /etc/fstab file in case of a reboot without me being physically present. Without the root NFS share mounting fails every time with the error “access denied to 1.2.3.4”

My /etc/fstab entry looks like this.

1.2.3.4:/mount /srv nfs rw,hard,intr 0 0

I have been using this method for a long time with no issues. But if there is a better way I’m all for it.

Odd, I can’t reproduce this error on my system (openSUSE Tumbleweed) using either fstab or manual mounting. In fact, I can even just do mount rockstor:/ /mnt/bar and it will let me mount this without explicitly specifying the export root in /etc/exports.

Is there any more detailed information in your system logs?

Edit:
Found two subtleties that may cause OS-dependent issues. One is that it may be required to mount using the full path, e.g. server:/export/foo instead of server:/foo; another is that you may have to specify nfs4 as the filesystem instead of nfs in fstab. See here for further details.

1 Like

If these variations fail to work for you though, it wouldn’t be an issue to have rockstor export the NFS root along with the rest. It seems to be fairly common practice in online NFS guides.

Initially tried both of those solutions and I couldn’t get either to work at all. The Ubuntu host that I’m using for my main testing is 16.04.

However after fixing a third party bug I was able to get the system to at least give me the deny message again.

So while those fixed it on one of my test systems it didn’t fix it on the newest version of Ubuntu in my testing.

Sorry for the delay. Been a crazy few days.

####Edit: Updated with newer test results