# ZFS over NFS



## MMacD (Aug 1, 2016)

I decided to build up my own fileserver rather than using one of the packaged ones.  It runs 10.2 with the default filesystem for the o/s and a 3-way ZFS mirror for the files that are served.

Now I want to add NFS, but there seems to be a lot of confusion about how to do that when ZFS is in the mix. 

Am I right in thinking that I can simply ignore the "zfs-ness" and put all the export information into /etc/exports, e.g.

/foo -allfiles 192.168.0.

where foo is the ZFS subtree to be shared, and 192.168.0. is the subnet that can attach it. 

Do I have to do anything more exciting than that?  I'm intentionally not doing maproot at this point, and I have /etc/rc.conf set up with 

```
rpcbind_enable="YES"
nfs_server_enable="YES"
nfs_client_enable="YES"
mountd_enable="YES"
mountd_flags="-r"
```


----------



## SirDice (Aug 1, 2016)

There's no such thing as "ZFS over NFS" or "UFS over NFS". NFS is a network filesystem, whatever filesystem is used locally is irrelevant.


----------



## MMacD (Aug 1, 2016)

Well, I'd change the title but there doesn't seem to be a way to do that.  I suppose I wrote it that way because I think of NFS as a species of network layer, since it doesn't actually organise storage on a static medium.

Your response suggests that I'm right in thinking that I can ignore the zfs-ness.  Yes?


----------



## SirDice (Aug 1, 2016)

MMacD said:


> Your response suggests that I'm right in thinking that I can ignore the zfs-ness. Yes?


Indeed. Just use exports(5).


----------



## MMacD (Aug 1, 2016)

The only entry in /etc/exports is `/foo -maproot=root` (a toy subtree not in ZFS's pool).  I called `mount reload`, but `showmount -e` still claims that nothing is being exported.   Evidently I'm missing something, but I can't think what or where.


----------



## SirDice (Aug 1, 2016)

Check /var/log/messages for errors.


----------



## ShelLuser (Aug 1, 2016)

Everything mentioned above is right. However, there is the sharenfs property which can be set for individual ZFS file systems. The result being that you can then share (or unshare) then using `zfs share`, maybe this is where the confusion came from?

However... As mentioned in the zfs(8) manualpage any file system which is marked as such is will be managed using exports(5). In other words: the traditional way of setting up NFS shares.

Hope this can help too.


----------



## MMacD (Aug 1, 2016)

SirDice said:


> Check /var/log/messages for errors.



I didn't know that that's where NFS puts its commentary, but once you told me, the complaint it made solved the problem, so thanks twice!

From what I can tell, everything that doesn't have a dedicated error log uses it.  Is there a way to turn off info messages from, e.g., my keyboard and mouse?  With my KVM in use, they fill up the file very quickly


----------

