Server
/etc/exports (one line per export): path network(options):
Options: rw/ro, sync (safe) / async (fast), root_squash (the
client's root maps to nobody, the default), no_subtree_check
(recommended).
Network directories over NFS — exporting on the server, mounting on the client, permissions.
sudo exportfs -ra
sudo exportfs -v
showmount -e server
nc -zv server 2049
is the NFS port reachable
NFS gives access to a server's directories over the network as if they were local. The server exports a directory, the client mounts it (mount). Common between Linux machines.
nfs-kernel-server package, exports in /etc/exports;nfs-common package, mounting via mount -t nfs./etc/exports (one line per export): path network(options):
Options: rw/ro, sync (safe) / async (fast), root_squash (the
client's root maps to nobody, the default), no_subtree_check
(recommended).
The client's IP doesn't match the mask in /etc/exports, or exportfs -ra
wasn't run after editing it. Check showmount -e server and the export
line itself.
NFS maps by UID/GID — the client and server need matching ones (or set up
idmapping for NFSv4). The client's root is "squashed" to nobody by
default (root_squash).
The firewall or the service. NFSv4 uses port 2049/tcp.
Check ss -tlnp on the server, and whether the port is reachable:
nc -zv server 2049.
A "hard" mount (the default) hangs processes indefinitely. For non-critical
data, use soft,timeo=50,retrans=2; in fstab, add
_netdev,nofail.
The export was recreated, or the filesystem was remounted on the server.
Remount on the client (umount/mount), with -o remount if needed.
Found an inaccuracy? Report an error in the article