- Tags: FreeBSD
First, configure to start service during the bootstrap:
sysrc nfs_server_enable="YES"
sysrc nfs_server_flags="-u -t -n 4"
sysrc rpcbind_enable="YES"
sysrc rpc_statd_enable="YES"
sysrc rpc_lockd_enable="YES"
sysrc mountd_flags="-r"
sysrc mountd_enable="YES"
Second, export volume to the network in /etc/exports
:
/data/warehouse -mapall=root -network 192.168.1.0/24
NOTE: you shouldn’t export the pool root while you are using ZFS, as it can’t show the children in a datasets of it.
And then we can start the services:
service nfsd start
service statd start
service lockd start
You need to stop extra services when you want to restart:
service mountd stop
service rpcbind stop
service nfsd restart
service statd restart
service lockd restart
Finally, we can use showmount
command to see if it works:
showamount -e 192.168.1.x # replace 192.168.1.x to your real ip