Solved: Jail, Dataset, NFS share? Help for someone moving from standard NFS to FreeNAS

Status
Not open for further replies.
Joined
Mar 15, 2016
Messages
6
I have an existing NFS server that I'm replacing with a FreeNAS system. The existing setup is that the NFS server has individual backup directories per IP-based server where each server gets access
only to it's own share/sub-directory.

So the existing physical setup on the old server is something like

Code:
/path/to/share/server1
/path/to/share/server2
/path/to/share/server3
(etc)


With access to each share being managed by IP address. In ext4 with NFS4 you'd setup an exports file like this:
Code:
/path/to/share/server1  x.x.x.1(rw,.....
/path/to/share/server2  x.x.x.2(rw,....
/path/to/share/server3  x.x.x.3(rw,....
etc.


I also have a parent NFS share that can be accessed and see all the subdirectories for the individual servers as read only: e.g. adding this to the exports file
Code:
/path/to/share/  x.x.x.y(ro,....)


So I'd like to setup something similar in FreeNAS, but while setting up the first NFS share was fine for the first share (server1), with the next share (server2) where I try to limit by IP I get

"The network 0.0.0.0/0 is already being shared and cannot be used twice for the same filesystem"


I don't understand why there's this limitation for shares via NFS under FreeNAS, but ok, fine if there's a workaround.

In looking at the documentation and forums it appears the that the of discussion suggests either creating jails, datasets, or using CIFS instead.

I know CIFS is not the best tool for this implementation as this is a server connection with access by IP, not shared by user perms, and this without any MS Windows stuff.

It appears that jails are for when you want to run some software from a share - so I think I don't need that.

I think a ZFS Dataset is simply a mountpoint folder which allows for additional features such as permissions for files and folders contained within that mountpoint. There won't be file transfer between datasets (I understand there's a performance hit on moving files between datasets on the same disk because ZFS treats different datasets as separate file systems). So ZFS datasets seems to be the best fit for what I want to do?

I wanted to know what the best practices were in regards to setting up a ZFS dataset correctly for this setup:

This thread talking about child datasets, but I don't see anything in the docs that discusses child datasets.

So the top question I have is what's the best practice here?

I'm guessing something like this:

* Do I have to create N+1 datasets where N is the number of servers, and the extra one is for the read-only share?

* If I share a parent dataset do all child datasets also appear even if child datasets are shared only to a specific IP address?

* Should (Can) I specify where datasets appear and use where the directories are already there? Or is it that (it appears in FreeNAS) all datasets created in /mnt (and below for child datasets)?
 
Joined
Mar 15, 2016
Messages
6
I solved the issue by playing around. It appears ZFS datasets are created in

/mnt/PoolName/DataSetName

or for a child

/mnt/PoolName/DataSetName/DataSetChild1Name

And the answer is yes, it does seem to be the case FreeNAS requires that you have to create a separate dataset for each NFS share if each share has different set of IP addresses that are authorized to mount that share.


That was a big block for me being used to just managing exports files. Can anyone explain the logic there? Why can't I just have NFS shares on subdirectories of a dataaset where each NFS share has different IP address access permissions?

The only thing that seems odd now are these messages in the log files:


Nov 1 14:34:36 nas1 mountd[72633]: can't change attributes for /mnt/Nas1Pool001/unixset001: Invalid radix node head, rn: 0 0xfffff80294579600
Nov 1 14:34:36 nas1 mountd[72633]: bad exports list line /mnt/Nas1Pool001/unixset001 -maproot


For the original dataset I created though I'm now getting an error. Did that happen because of this? Something else? I don't know. All is working well except for the error messages. Solution seems to be to delete and re-create the dataset
 
Status
Not open for further replies.
Top