<?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 Wimpy's World</title><link>https://blog.wimpys.world/tags/nfs/</link><description>Recent content in NFS on Wimpy's World</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><managingEditor>martin@wimpress.com (Martin Wimpress)</managingEditor><webMaster>martin@wimpress.com (Martin Wimpress)</webMaster><lastBuildDate>Fri, 26 Jul 2013 12:00:00 +0000</lastBuildDate><atom:link href="https://blog.wimpys.world/tags/nfs/rss.xml" rel="self" type="application/rss+xml"/><item><title>NFS and CIFS mounts with systemd</title><link>https://blog.wimpys.world/posts/nfs-and-cifs-mounts-with-systemd/</link><pubDate>Fri, 26 Jul 2013 12:00:00 +0000</pubDate><author>martin@wimpress.com (Martin Wimpress)</author><guid>https://wimpysworld.com/posts/nfs-and-cifs-mounts-with-systemd/</guid><description>&lt;p&gt;I have an NFS server at home and at work we have Windows (not Samba) servers.
When I first switched to &lt;code&gt;systemd&lt;/code&gt; I noticed that boot and shutdown were
seriously delayed while NFS and CIFS were mounted/unmounted. &lt;code&gt;systemd&lt;/code&gt; was
designed to eliminate those kinds of delays, so I did some research to find
out how to correctly mount NFS and CIFS using &lt;code&gt;systemd&lt;/code&gt;.&lt;/p&gt;
&lt;h1 id="systemd-friendly-fstab"&gt;systemd friendly fstab&lt;/h1&gt;
&lt;p&gt;Below are some example &lt;code&gt;/etc/fstab&lt;/code&gt; entries for NFS and CIFS mounts that are
&lt;code&gt;systemd&lt;/code&gt; friendly, the pertinent mount options are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;noauto,x-systemd.automount,_netdev&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I found that &lt;code&gt;noauto,x-systemd.automount&lt;/code&gt; improved the boot performance and
&lt;code&gt;_netdev&lt;/code&gt; improved the shutdown performance.&lt;/p&gt;
&lt;h2 id="nfs"&gt;NFS&lt;/h2&gt;
&lt;p&gt;This is typically what I have use for mounting my home NAS.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nfs-server:/SomeData /media/SomeData nfs defaults,noauto,x-systemd.automount,_netdev,noatime 0 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="cifs"&gt;CIFS&lt;/h2&gt;
&lt;p&gt;This is what I use at work to work correctly with Windows Server.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;//cifs-server/MoreData /media/MoreData cifs defaults,noauto,x-systemd.automount,_netdev,rw,noperm,credentials=/home/username/.smb-credentials 0 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The contents of the credentials file looks something like this.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;yourusername&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;yourpassword&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;domain&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;COMPANYDOMAIN&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="references"&gt;References&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/Systemd#Filesystem_mounts"&gt;https://wiki.archlinux.org/index.php/Systemd#Filesystem_mounts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><summary>Wait for network when mounting NFS and CIFS volumes</summary></item></channel></rss>