<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.scott5.org/index.php?action=history&amp;feed=atom&amp;title=Nfs4</id>
	<title>Nfs4 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.scott5.org/index.php?action=history&amp;feed=atom&amp;title=Nfs4"/>
	<link rel="alternate" type="text/html" href="https://wiki.scott5.org/index.php?title=Nfs4&amp;action=history"/>
	<updated>2026-04-13T00:33:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.scott5.org/index.php?title=Nfs4&amp;diff=644&amp;oldid=prev</id>
		<title>Scott at 00:10, 15 February 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.scott5.org/index.php?title=Nfs4&amp;diff=644&amp;oldid=prev"/>
		<updated>2011-02-15T00:10:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{lowercase title}}&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
* for server:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get install nfs-kernel-server &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* for client:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get install nfs-common &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common Setup ==&lt;br /&gt;
* In &amp;lt;tt&amp;gt;/etc/default/nfs-common&amp;lt;/tt&amp;gt; set:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NEED_IDMAPD=yes&lt;br /&gt;
NEED_GSSD=no &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Edit &amp;lt;tt&amp;gt;/etc/idmapd.conf&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Domain = mydomain.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Restart the &amp;lt;tt&amp;gt;nfs-common&amp;lt;/tt&amp;gt; service:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo /etc/init.d/nfs-common restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Server Setup ==&lt;br /&gt;
* In &amp;lt;tt&amp;gt;/etc/default/nfs-kernel-server&amp;lt;/tt&amp;gt; set:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NEED_SVCGSSD=no &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Edit &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; to look something like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/export/nfs          \&lt;br /&gt;
123.45.67.12(rw,sync,insecure,no_subtree_check,anonuid=65534,anongid=65534,fsid=0) \&lt;br /&gt;
123.45.67.13(rw,sync,insecure,no_subtree_check,anonuid=65534,anongid=65534,fsid=0) \&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Export options:  http://linux.die.net/man/5/exports&lt;br /&gt;
** sync vs async - Always use sync. This asks the server to write data immediately, important when crashes are possible&lt;br /&gt;
* restart the services:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/init.d/nfs-kernel-server restart&lt;br /&gt;
/etc/init.d/nfs-common restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Allow clients to access TCP port 2049. Example: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -A INPUT --protocol tcp --dport 2049 --source 123.45.67.89 -m state --state NEW -j ACCEPT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Important Note ===&lt;br /&gt;
There is a problem with the NFS server under Ubuntu versions &amp;#039;&amp;#039;before&amp;#039;&amp;#039; 9.04 (Jaunty).  Whenever the file server gets rebooted, you need to immediately log in and restart the &amp;lt;tt&amp;gt;nfs-common&amp;lt;/tt&amp;gt; service:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo /etc/init.d/nfs-common restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Client Setup ==&lt;br /&gt;
* Create the mounting directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /nfs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* For a static mount, add something like this to &amp;lt;tt&amp;gt;/etc/fstab&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
123.45.67.10:/ /nfs            nfs4    rw,hard,intr,proto=tcp,port=2049 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Automounting on the client ===&lt;br /&gt;
Follow the instructions at [[autofs]].&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
* https://help.ubuntu.com/community/NFSv4Howto&lt;br /&gt;
* Did you add an exception to the firewall?&lt;br /&gt;
* If user/group id&amp;#039;s are showing up as &amp;lt;tt&amp;gt;nobody&amp;lt;/tt&amp;gt; on the client, you need to restart the &amp;lt;tt&amp;gt;nfs-common&amp;lt;/tt&amp;gt; service on the server:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo /etc/init.d/nfs-common restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* User and group ids must be the same on both client and server. This may be achieved either through passwd/group files or through LDAP.&lt;br /&gt;
* Both client and server should be using ntp to sync clocks.&lt;br /&gt;
* Use these commands to monitor NFS activity:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpcinfo -p&lt;br /&gt;
netstat -tupa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Check NFS mount options by viewing &amp;lt;code&amp;gt;/proc/mounts&amp;lt;/code&amp;gt;.&lt;br /&gt;
* You can get a &amp;quot;Stale NFS file handle&amp;quot; error if the NFS server goes down for awhile. The best solution is to completely unmount and remount, but if you can&amp;#039;t unmount, just remount over the existing mount anyway.&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
	</entry>
</feed>