# sharenfs+sharesmb unsupported?



## meka (Jun 27, 2013)

Hi,

*I*'m running a pretty much vanilla FreeBSD 9.1 (amd64) installation. One thing is puzzling me on which I did find very little results searching the web. I try to enable _NFS_ and _S_amba sharing like this:

```
zfs set sharenfs=on tank0/Videos
zfs set sharesmb=on tank0/Videos
```
Both result in a simple error message: 
	
	



```
Unsupported share protocol: 1.
```
 Did I get a wrong version or why isn't it working? But regardless of that error message the state of the property chances to "on" but I cannot connect to it.

Any ideas?  Thank you very much.


----------



## SirDice (Jun 27, 2013)

The sharesmb option doesn't work. However, sharenfs does work but it's a bit of a hack on FreeBSD. On Solaris it can communicate directly with the NFS (or CIFS in the case of sharesmb) implementation in the kernel. On FreeBSD it simply creates a /etc/zfs/exports which is loaded by FreeBSD's nfsd(8).


```
root@molly:~ # zfs get sharenfs storage/media
NAME           PROPERTY  VALUE                                     SOURCE
storage/media  sharenfs  maproot=0,network=2001:470:1f15:bcd::/64  local
root@molly:~ # cat /etc/zfs/exports | grep media
/storage/media  -maproot=0 -network=2001:470:1f15:bcd::/64
```


----------



## phoenix (Jun 27, 2013)

In other words, to export a ZFS filesystem or directory via SMB/CIFS, use Samba.

And, to export a ZFS filesystem or directory via NFS, use the standard /etc/exports file.

Don't treat ZFS like anything special when it comes to sharing files over a network.  Use the normal tools you would use to share UFS or any other filesystem.


----------



## meka (Jun 28, 2013)

Thanks. fair enough... Is it possible for nfsd(8) to also monitor /etc/zfs/exports?


----------



## SirDice (Jun 28, 2013)

meka said:
			
		

> Is it possible for nfsd(8) to also monitor /etc/zfs/exports?



It already does.


----------

