<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technical Diary &#187; autofs</title>
	<atom:link href="http://andriigrytsenko.net/tag/autofs/feed/" rel="self" type="application/rss+xml" />
	<link>http://andriigrytsenko.net</link>
	<description>With Andrii Grytsenko</description>
	<lastBuildDate>Wed, 28 Jul 2010 09:02:46 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to export NFS home directories over the Autofs</title>
		<link>http://andriigrytsenko.net/2009/08/how-to-export-nfs-home-directories-over-the-autofs/</link>
		<comments>http://andriigrytsenko.net/2009/08/how-to-export-nfs-home-directories-over-the-autofs/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 03:16:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[autofs]]></category>
		<category><![CDATA[nfs]]></category>

		<guid isPermaLink="false">http://andriigrytsenko.net/?p=417</guid>
		<description><![CDATA[Step-by-step instruction to get benefits from NFS and Autofs.

We have two machines as always:

srv2: has NFS server and a lot of disk space.(IP 10.0.30.2)
srv1: has users and autofs daemon(IP 10.0.30.1)

Go to srv1 and make new user: 
srv1#adduser user1
Get id: 
srv1#id user1
uid=500(user1) gid=500(user1) groups=500(user1)
Open console on srv2 and make directory for home&#8217;s directoies:
srv2#mkdir /export_home
now make directory [...]]]></description>
			<content:encoded><![CDATA[<p>Step-by-step instruction to get benefits from NFS and Autofs.</p>
<p><span id="more-417"></span></p>
<p>We have two machines as always:</p>
<ul>
<li>srv2: has NFS server and a lot of disk space.(IP 10.0.30.2)</li>
<li>srv1: has users and autofs daemon(IP 10.0.30.1)</li>
</ul>
<p>Go to srv1 and make new user: </p>
<pre>srv1#adduser user1</pre>
<p>Get id: </p>
<pre>srv1#id user1
uid=500(user1) gid=500(user1) groups=500(user1)</pre>
<p>Open console on srv2 and make directory for home&#8217;s directoies:</p>
<pre>srv2#mkdir /export_home</pre>
<p>now make directory for specific user(user1):</p>
<pre>srv2#mkdir /export_home/user1</pre>
<p>and set proper owner:</p>
<pre>srv2#chown 501 /export_home/user1</pre>
<p>!!!where 501 owner ID which is got  from srv1.</p>
<p>Next step is NFS configuration at srv2. Open <em>/etc/exports</em> and add new share point:</p>
<pre>/export_home/user1     10.0.30.1(rw)</pre>
<p>After changes is done reload services and put into boot:</p>
<pre>/etc/init.d/nfs reload
chkconfig --level 45 nfs on</pre>
<p>srv2 is completely done. Back to srv1:<br />
Add new line into <em>/etc/auto.master</em>:</p>
<pre>/home   /etc/auto.home</pre>
<p>It&#8217;s pointed at new configuration file which will define mount point for /home directory. Put next line into it(<em>/etc/auto.home</em>):</p>
<pre>user1            -rw,soft,intr           10.0.30.2:/export_home/user1</pre>
<p>This line means mount NFS share <em>/export_home/user1</em> from server 10.0.30.2 into local directory <em>/home/user1</em>. Restart autofs daemon to make changes take effect:</p>
<pre>/etc/init.d/autofs restart</pre>
<p>Now when you log in into system as user1 the NFS share from remote host will mount as your home directory. And will be unmount in timeout(300 seconds by default) after you have logged out.</p>
<p>Also you can put together this system with NIS so as to use common user database. As benefits you will get very flexible system and simplified user management.</p>
]]></content:encoded>
			<wfw:commentRss>http://andriigrytsenko.net/2009/08/how-to-export-nfs-home-directories-over-the-autofs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
