Migrate to RunxBuild and earn up to $50 in hosting credit on your first deposit.

Calculate your savings
unxBuild

NFS Mount on Linux: mount, fstab, and the Right Defaults

Sean

Platform Writer

Jul 05, 2026
5 min read

NFS mount on Linux is mount -t nfs server:/path /mnt for a one-off mount or an /etc/fstab entry for persistence. Use hard mount type with reasonable timeouts (timeo=600, retrans=5) for production - soft mounts give up on errors and risk data corruption. The team that uses these defaults has reliable NFS. The team that copies options from old blog posts has flaky mounts.

NFS Mount on Linux: mount, fstab, and the Right Defaults

Table of contents

Quick mount

One-off mount:

mount -t nfs server.example.com:/exported/path /mnt/local

Verify:

df -h /mnt/local
ls /mnt/local

The team that has the server hostname and exported path right has it working in seconds.

Persistent mount with fstab

server.example.com:/exported/path /mnt/local nfs defaults,_netdev 0 0

The _netdev option is critical - it tells systemd to wait for the network before attempting the mount. Without it, the boot fails if the NFS server isn’t reachable yet.

Test without reboot:

sudo mount -a

If mount -a fails, fix the fstab before rebooting.

server:/path /mnt/local nfs hard,timeo=600,retrans=5,_netdev,noatime 0 0
  • hard: Retry indefinitely on errors. The client never gives up.
  • timeo=600: Timeout in deciseconds (60 seconds).
  • retrans=5: Number of retries before declaring failure.
  • _netdev: Wait for network.
  • noatime: Don’t update file access times (perf win).

hard vs soft: hard retries indefinitely and is correct for production. soft gives up after retries and returns errors to the application - this can cause silent data corruption if a write is interrupted.

The team that uses hard for production databases and critical data is correct. The team that uses soft because “it’s faster” loses data on network blips.

NFS version selection

Default in modern Linux: NFSv4.2 (auto-negotiated).

To force a specific version:

server:/path /mnt/local nfs vers=4.1,_netdev 0 0
  • NFSv3: Most compatible, no encryption, no Kerberos.
  • NFSv4: Required for Kerberos, better locking.
  • NFSv4.1: pNFS for parallel I/O.
  • NFSv4.2: Server-side copy, sparse files.

The team that has NFSv4.1+ servers and clients uses pNFS for better throughput. The team that has older clients stays on v3.

Unmounting

When the share is no longer needed:

umount /mnt/local
# or
umount server:/path

If the share is busy (open files, processes using it), umount fails with device is busy. The fix:

# Find what's using it
lsof /mnt/local
fuser /mnt/local
# or force
umount -l /mnt/local   # lazy unmount

The team that uses lsof or fuser finds the blocking process. The team that force-unmounts (umount -f) risks data corruption.

FAQ

What’s the difference between hard and soft NFS mounts?

Hard: retries indefinitely on errors. Soft: gives up after timeouts and returns errors. Hard is correct for production - soft risks silent data corruption. The team that uses soft for performance reasons loses data on network blips.

Can I mount NFS without root?

Yes, with the right fstab options. The user option user allows non-root users to mount. The team that runs desktop NFS mounts uses user; the team that runs server mounts uses defaults.

Why is my mount timing out at boot?

Missing _netdev in fstab - the mount tries before the network is up. The fix is nfs defaults,_netdev in the fstab entry.

What is the NFS port?

NFSv4 uses TCP port 2049. NFSv3 also uses 2049 + portmap (111) + mountd (typically 20048) + nlockmgr. The team that firewalls only allows 2049 if using NFSv4. NFSv3 needs more ports.

How do I check NFS performance?

nfsstat -m shows mount options and stats. nfsstat -c shows client-side stats (read/write operations, retries). iostat -x 1 shows underlying disk I/O. The team that benchmarks NFS finds the bottleneck (network vs disk vs client CPU).

If you are sizing the infrastructure for the kind of project this post covers, the RunxBuild hosting calculator is the right place to model the line items. The compute, the memory, the storage, the bandwidth, the database - each one is a separate number, and the team’s mental model for the platform is the sum of those numbers. The RunxBuild dashboard is where the team sees the actual usage in one place.

Useful related references:

#nfs#linux#mount#dev-infra