User Tools

Site Tools


quickreference:nfs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
quickreference:nfs [2024/06/10 20:19] – nfs quick reference guide rodolicoquickreference:nfs [2025/03/09 00:01] (current) rodolico
Line 2: Line 2:
  
 ===== Some useful commands ===== ===== Some useful commands =====
-====== NFS Quick Reference ====== 
  
-===== Commands ===== 
 ==== Finding mounts we can use ==== ==== Finding mounts we can use ====
 If you put the server's IP address (or DNS name) below, it will show all NFS mounts available to your machine If you put the server's IP address (or DNS name) below, it will show all NFS mounts available to your machine
 <code bash> <code bash>
 showmount -e serverip showmount -e serverip
 +</code>
 +
 +==== restart nfsd ====
 +nfs on FreeBSD is very particular in which order you restart the services. In particular, rpcbind **must** be the first service restarted. To restart the entire system, use the following. Under normal circumstances, this will not be noticed by the client machines.
 +
 +<code bash>
 +service rpcbind restart
 +service nfsd restart
 +service mountd restart
 +service lockd restart
 +
 +</code>
 +
 +
 +===== lockd =====
 +
 +==== lockd not starting ====
 +
 +lockd can get messed up (on FreeBSD server). It says it starts, but it doesn't. In /var/log/messages, you'll see the line:
 +<code>Can't start NLM - unable to contact NSM</code>
 +
 +This is because of a corrupt statd file. You can fix the problem, generally, with the following commands taken from [[https://forums.freebsd.org/threads/failed-to-contact-local-nsm-rpc-error-5.16474/]]
 +<code bash>
 +service statd stop
 +service lockd stop
 +rm /var/db/statd.status
 +service statd start
 +service lockd start
 </code> </code>
  
Line 28: Line 54:
 <code bash> <code bash>
 service lockd status service lockd status
 +</code>
 +
 +===== Sample rc.conf =====
 +
 +<code autoconf rc.conf.nfs>
 +### NFS
 +
 +# enable rpcbind server
 +rpcbind_enable="YES"
 +
 +# enable nfs server (v3)
 +nfs_server_enable="YES"
 +
 +# uncomment to enable nfsv4 server
 +# nfsv4_server_enable="YES"
 +
 +# enable mountd (required)
 +mountd_enable="YES"
 +
 +# set flags for mountd (man 8 mountd)
 +# -h binds nfsd to a specific IP, so a machine with
 +#    multiple IP's will only respond if this one is used for the
 +#    request.
 +# -r allow a file to be mounted
 +# -p bind mountd to a particular port (helps with firewalls)
 +mountd_flags="-r -h 10.10.10.10 -p 59000"
 +
 +# enable lockd
 +# uncomment the following lines if server side file locks are
 +# needed. Note you must replicate this on the clients
 +rpc_lockd_enable="YES"
 +rpc_statd_enable="YES"
 +
 +# parameters for statd (man 8 rpc.statd)
 +# -d send debugging to syslog
 +# -p use static port (helps with firewalls)
 +# -h IP - bind to IP address
 +
 +rpc_statd_flags="-d -p 59001"
 +
 +# parameters for lockd (man 8 rpc.lockd)
 +# -d send debugging to syslog
 +# -p use static port (helps with firewalls)
 +# -h IP - bind to IP address
 +rpc_lockd_flags="-d 10 -p 59002"
 </code> </code>
quickreference/nfs.1718068777.txt.gz · Last modified: 2024/06/10 20:19 by rodolico