Pcornel
Linux · File Services

NFS

Cheat sheet · https://pcornel.dk/topic.php?topic=2882

Back to the Topic

Answer

NFS (Network File System) shares directories from a Linux server to clients. NFSv4 uses one port (TCP 2049) and supports Kerberos; NFSv3 also needs rpcbind and helper ports.

Remember

Prefer NFSv4. Permissions are by UID/GID unless Kerberos and ID mapping are used — keep IDs consistent. root_squash (default) maps client root to nobody.

First checks

  • showmount -e <server> / exportfs -v — NFS exports
  • findmnt -t nfs,nfs4,cifs — mounted network shares
  • smbclient -L //<server> -U <user> — SMB shares
  • testparm -s — Samba configuration check

Commands

findmnt -t nfs4
mount

Verify in this order

export defined → nfs-server running → client mounts → requests carried on 2049 → UID/GID checked on the server

Where it usually breaks

First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2882

Confirmation

Confirm action

Continue?