<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NFS on Chris Titus Tech | Tech Content Creator</title><link>https://christitus.com/tags/nfs/</link><description>Recent content in NFS on Chris Titus Tech | Tech Content Creator</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><managingEditor>Chris Titus</managingEditor><webMaster>Chris Titus</webMaster><lastBuildDate>Sat, 25 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://christitus.com/tags/nfs/index.xml" rel="self" type="application/rss+xml"/><item><title>Best NFS Network Drive Settings for Linux</title><link>https://christitus.com/fix-nfs-network-drives/</link><pubDate>Sat, 25 Apr 2026 00:00:00 +0000</pubDate><author>Chris Titus</author><guid>https://christitus.com/fix-nfs-network-drives/</guid><description>&lt;p&gt;Most people mount NFS shares with a short line and move on. That works, but if you use network storage heavily (media libraries, VMs, homelab backups, project files), your mount options directly affect reliability, boot behavior, and performance.&lt;/p&gt;
&lt;p&gt;This guide breaks down a practical high-reliability NFS option set and compares it to a basic mount setup, using Linux &lt;code&gt;nfs-utils&lt;/code&gt; mount documentation (&lt;code&gt;man 5 nfs&lt;/code&gt;) and systemd mount behavior (&lt;code&gt;man 5 systemd.mount&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id="quick-comparison-basic-vs-tuned"&gt;Quick Comparison: Basic vs Tuned&lt;/h2&gt;
&lt;h3 id="basic-fstab-entry"&gt;Basic fstab entry&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nas:/data /mnt/data nfs defaults 0 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="tuned-fstab-entry-example"&gt;Tuned fstab entry (example)&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nas:/data /mnt/data nfs nfsvers=4.1,bg,hard,nofail,noatime,rsize=1048576,wsize=1048576,timeo=600,retrans=5,x-systemd.automount,x-systemd.mount-timeout=90,_netdev 0 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="what-changes"&gt;What changes?&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Area&lt;/th&gt;
&lt;th&gt;Basic (&lt;code&gt;defaults&lt;/code&gt;)&lt;/th&gt;
&lt;th&gt;Tuned Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;NFS protocol version&lt;/td&gt;
&lt;td&gt;Auto-negotiate&lt;/td&gt;
&lt;td&gt;Pinned to &lt;code&gt;4.1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failure behavior&lt;/td&gt;
&lt;td&gt;Default retry behavior&lt;/td&gt;
&lt;td&gt;Explicit &lt;code&gt;hard&lt;/code&gt; retries forever (safer for data integrity)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Boot experience&lt;/td&gt;
&lt;td&gt;May block depending on environment&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nofail&lt;/code&gt; + &lt;code&gt;x-systemd.automount&lt;/code&gt; helps avoid boot hangs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Network timing&lt;/td&gt;
&lt;td&gt;Generic defaults&lt;/td&gt;
&lt;td&gt;Explicit &lt;code&gt;timeo=600,retrans=5&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Throughput tuning&lt;/td&gt;
&lt;td&gt;Negotiated defaults&lt;/td&gt;
&lt;td&gt;Forces &lt;code&gt;rsize/wsize&lt;/code&gt; up to 1 MiB cap&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access-time writes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;relatime&lt;/code&gt; typically&lt;/td&gt;
&lt;td&gt;&lt;code&gt;noatime&lt;/code&gt; to reduce metadata writes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Network ordering&lt;/td&gt;
&lt;td&gt;Auto-detected for NFS&lt;/td&gt;
&lt;td&gt;Explicit &lt;code&gt;_netdev&lt;/code&gt; dependency&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="option-by-option-breakdown"&gt;Option-by-Option Breakdown&lt;/h2&gt;
&lt;p&gt;Reference base: &lt;code&gt;man 5 nfs&lt;/code&gt; and &lt;code&gt;man 5 systemd.mount&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id="nfsvers41"&gt;&lt;code&gt;nfsvers=4.1&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;What it does: Pins the client to NFSv4.1.&lt;/li&gt;
&lt;li&gt;Official behavior: Without &lt;code&gt;nfsvers&lt;/code&gt; (or &lt;code&gt;vers&lt;/code&gt;), Linux clients typically try newer NFS versions first and negotiate down.&lt;/li&gt;
&lt;li&gt;Why use it: Predictability. If server and clients are known-good on 4.1, pinning avoids surprises after updates.&lt;/li&gt;
&lt;li&gt;Tradeoff: You lose automatic use of newer protocol features (for example, if 4.2 is supported and useful).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="bg"&gt;&lt;code&gt;bg&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;What it does: If mount fails/timeouts, mount helper retries in the background.&lt;/li&gt;
&lt;li&gt;Official behavior (&lt;code&gt;nfs(5)&lt;/code&gt;): Parent returns success while child keeps retrying.&lt;/li&gt;
&lt;li&gt;systemd detail (&lt;code&gt;systemd.mount(5)&lt;/code&gt;): &lt;code&gt;systemd-fstab-generator&lt;/code&gt; translates &lt;code&gt;bg&lt;/code&gt; semantics and effectively applies behavior similar to long retries plus &lt;code&gt;fg,nofail&lt;/code&gt; handling under systemd job control.&lt;/li&gt;
&lt;li&gt;Why use it: Better boot resilience when NAS/network is slow.&lt;/li&gt;
&lt;li&gt;Tradeoff: Failure may be less obvious immediately because retries continue in background.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="hard"&gt;&lt;code&gt;hard&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;What it does: NFS operations retry indefinitely after timeout.&lt;/li&gt;
&lt;li&gt;Official behavior: &lt;code&gt;hard&lt;/code&gt; is default and strongly preferred for data integrity; &lt;code&gt;soft&lt;/code&gt; can return I/O errors and may risk silent corruption in some workflows.&lt;/li&gt;
&lt;li&gt;Why use it: Correctness and durability over convenience.&lt;/li&gt;
&lt;li&gt;Tradeoff: Apps can hang waiting for server recovery.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="nofail"&gt;&lt;code&gt;nofail&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;What it does: Mount is wanted, not required, during boot.&lt;/li&gt;
&lt;li&gt;Official behavior (&lt;code&gt;systemd.mount(5)&lt;/code&gt;): Boot continues even if mount is unavailable; unit is not ordered to block boot target completion.&lt;/li&gt;
&lt;li&gt;Why use it: Prevent boot failures when NAS is down.&lt;/li&gt;
&lt;li&gt;Tradeoff: Service depending on that path may fail later unless you handle dependency checks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="noatime"&gt;&lt;code&gt;noatime&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;What it does: Disables access-time updates on reads.&lt;/li&gt;
&lt;li&gt;Why use it: Reduces metadata traffic and write amplification on busy shares.&lt;/li&gt;
&lt;li&gt;Tradeoff: Loses accurate &lt;code&gt;atime&lt;/code&gt; semantics for tools/workflows that rely on access timestamps.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="rsize1048576"&gt;&lt;code&gt;rsize=1048576&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;What it does: Sets max read request payload to 1,048,576 bytes (1 MiB).&lt;/li&gt;
&lt;li&gt;Official behavior (&lt;code&gt;nfs(5)&lt;/code&gt;): Linux NFS client max read payload is 1 MiB; unsupported values are clamped/rounded according to rules.&lt;/li&gt;
&lt;li&gt;Why use it: High-throughput sequential read workloads can benefit.&lt;/li&gt;
&lt;li&gt;Tradeoff: If network/server path can’t handle large I/O well, negotiated defaults may perform more consistently.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="wsize1048576"&gt;&lt;code&gt;wsize=1048576&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;What it does: Sets max write request payload to 1 MiB.&lt;/li&gt;
&lt;li&gt;Official behavior (&lt;code&gt;nfs(5)&lt;/code&gt;): Same cap/rounding behavior as &lt;code&gt;rsize&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Why use it: Helps throughput for large sequential writes.&lt;/li&gt;
&lt;li&gt;Tradeoff: Same caution as &lt;code&gt;rsize&lt;/code&gt;; test with your server/network.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="timeo600"&gt;&lt;code&gt;timeo=600&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;What it does: Sets RPC timeout in deciseconds.&lt;/li&gt;
&lt;li&gt;Official behavior (&lt;code&gt;nfs(5)&lt;/code&gt;): For TCP, &lt;code&gt;600&lt;/code&gt; means 60 seconds; TCP uses linear backoff and this value is already the standard default for TCP/RDMA.&lt;/li&gt;
&lt;li&gt;Why use it: Mainly explicitness/documentation in your &lt;code&gt;fstab&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Tradeoff: Usually redundant for TCP NFS because it matches default behavior.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="retrans5"&gt;&lt;code&gt;retrans=5&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;What it does: Number of retries before the client escalates recovery behavior.&lt;/li&gt;
&lt;li&gt;Official behavior (&lt;code&gt;nfs(5)&lt;/code&gt;): TCP default retry count is lower by default; with &lt;code&gt;hard&lt;/code&gt;, the client still continues broader recovery even after retry cycles.&lt;/li&gt;
&lt;li&gt;Why use it: More tolerance for transient network stalls before warning/recovery transitions.&lt;/li&gt;
&lt;li&gt;Tradeoff: Longer delay before surfacing responsiveness issues.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="x-systemdautomount"&gt;&lt;code&gt;x-systemd.automount&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;What it does: Creates an automount unit so the share mounts on first access rather than during early boot.&lt;/li&gt;
&lt;li&gt;Official behavior (&lt;code&gt;systemd.mount(5)&lt;/code&gt;): Generates an automount unit from &lt;code&gt;fstab&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Why use it: Excellent for laptops/desktops/homelabs where network readiness timing is inconsistent.&lt;/li&gt;
&lt;li&gt;Tradeoff: First access to the path incurs mount latency.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="x-systemdmount-timeout90"&gt;&lt;code&gt;x-systemd.mount-timeout=90&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;What it does: Limits how long systemd waits for mount command completion.&lt;/li&gt;
&lt;li&gt;Official behavior (&lt;code&gt;systemd.mount(5)&lt;/code&gt;): &lt;code&gt;fstab&lt;/code&gt;-only option that maps to mount job timeout behavior.&lt;/li&gt;
&lt;li&gt;Why use it: Prevents very long hangs on dead endpoints.&lt;/li&gt;
&lt;li&gt;Tradeoff: Too short a timeout can fail mounts on slow links/startup races.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="_netdev"&gt;&lt;code&gt;_netdev&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;What it does: Explicitly marks mount as network-dependent.&lt;/li&gt;
&lt;li&gt;Official behavior (&lt;code&gt;systemd.mount(5)&lt;/code&gt;): Pulls in network-online ordering and treats mount as remote fs.&lt;/li&gt;
&lt;li&gt;Why use it: Makes dependency intent explicit, especially in complex setups/VPN/overlay networks.&lt;/li&gt;
&lt;li&gt;Tradeoff: Usually redundant for plain NFS, but helpful for clarity and edge cases.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="final-0-0"&gt;Final &lt;code&gt;0 0&lt;/code&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;First &lt;code&gt;0&lt;/code&gt;: dump backup utility field (commonly unused, usually &lt;code&gt;0&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Second &lt;code&gt;0&lt;/code&gt;: &lt;code&gt;fsck&lt;/code&gt; order. NFS is network fs and not checked via local &lt;code&gt;fsck&lt;/code&gt;, so &lt;code&gt;0&lt;/code&gt; is correct.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="is-the-tuned-line-always-better"&gt;Is the Tuned Line Always Better?&lt;/h2&gt;
&lt;p&gt;No. A basic entry is fine for light use:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nas:/data /mnt/data nfs defaults,_netdev,nofail 0 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That is often enough for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Home media shares&lt;/li&gt;
&lt;li&gt;Occasional backups&lt;/li&gt;
&lt;li&gt;Non-critical personal files&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Use the tuned profile when you care about predictable behavior under failure and want stricter control over boot/mount characteristics.&lt;/p&gt;
&lt;h2 id="practical-recommended-profiles"&gt;Practical Recommended Profiles&lt;/h2&gt;
&lt;h3 id="1-balanced-desktoplaptop"&gt;1) Balanced desktop/laptop&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nas:/data /mnt/data nfs nfsvers=4.1,hard,nofail,_netdev,x-systemd.automount,x-systemd.mount-timeout=90 0 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="2-throughput-focused-lan-workstation"&gt;2) Throughput-focused LAN workstation&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nas:/data /mnt/data nfs nfsvers=4.1,hard,noatime,rsize=1048576,wsize=1048576,timeo=600,retrans=5,_netdev,nofail 0 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="3-minimal-and-safe"&gt;3) Minimal and safe&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nas:/data /mnt/data nfs defaults,_netdev,nofail 0 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="verify-what-is-actually-active"&gt;Verify What Is Actually Active&lt;/h2&gt;
&lt;p&gt;After mounting, validate effective options (especially negotiated &lt;code&gt;rsize/wsize&lt;/code&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;findmnt -t nfs,nfs4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nfsstat -m
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat /proc/mounts &lt;span class="p"&gt;|&lt;/span&gt; grep &lt;span class="s1"&gt;&amp;#39; /mnt/data &amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The value in &lt;code&gt;fstab&lt;/code&gt; is your request. The effective value can differ after client/server negotiation.&lt;/p&gt;
&lt;h2 id="official-documentation-sources"&gt;Official Documentation Sources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;man 5 nfs&lt;/code&gt; (from nfs-utils package on Linux)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;man 8 mount.nfs&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;man 5 systemd.mount&lt;/code&gt; (for &lt;code&gt;x-systemd.*&lt;/code&gt;, &lt;code&gt;_netdev&lt;/code&gt;, and &lt;code&gt;nofail&lt;/code&gt; behavior)&lt;/li&gt;
&lt;li&gt;Upstream nfs-utils project: &lt;a href="https://github.com/stefanha/nfs-utils"&gt;https://github.com/stefanha/nfs-utils&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="final-thoughts"&gt;Final Thoughts&lt;/h2&gt;
&lt;p&gt;If you just want a stable setup, start with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nas:/data /mnt/data nfs defaults,_netdev,nofail 0 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you want stronger control over reliability and behavior under failures, your advanced line is a strong baseline, especially with &lt;code&gt;hard&lt;/code&gt;, &lt;code&gt;nofail&lt;/code&gt;, and &lt;code&gt;x-systemd.automount&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The best NFS config is not the longest one. It is the one you can explain, verify, and maintain.&lt;/p&gt;</description></item></channel></rss>