<?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>LAMP with ·dotmanila &#187; nfs client</title>
	<atom:link href="http://dotmanila.com/blog/tag/nfs-client/feed/" rel="self" type="application/rss+xml" />
	<link>http://dotmanila.com/blog</link>
	<description>Linux, Apache, PHP, MySQL Musings</description>
	<lastBuildDate>Sun, 01 Apr 2012 17:24:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>FreeBSD NFS Server and CentOS NFS Client</title>
		<link>http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/</link>
		<comments>http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 11:24:42 +0000</pubDate>
		<dc:creator>jervin</dc:creator>
				<category><![CDATA[BSD/Mac OSX]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[nfs client]]></category>
		<category><![CDATA[nfs server]]></category>

		<guid isPermaLink="false">http://dotmanila.com/blog/?p=30</guid>
		<description><![CDATA[We were recently migrating a busy site from an aging FreeBSD 5.4 and we cannot disrupt operations while switching platforms from FreeBSD to CentOS. So part of the plan was to share via NFS media files from the old FreeBSD server to the new CentOS.]]></description>
			<content:encoded><![CDATA[<p>We were recently migrating a busy site from an aging FreeBSD 5.4 and we cannot disrupt operations while switching platforms from FreeBSD to CentOS. So part of the plan was to share via NFS media files from the old FreeBSD server to the new CentOS.</p>
<p>Here are the steps that I had to do:</p>
<ol>
<li>Modify <code>/etc/exports</code> file to include directories you want shared. Ours look something like this:
<pre>
/usr/home/web01/images /usr/home/web01/swf    192.168.0.4
</pre>
<p>Notice the two consecutive directories. From the man pages, when mounting two directories from the same mountpoint or filesystem it will go the same line on the exports file or you&#8217;ll get errors like:</p>
<pre>
Dec  8 10:20:42 web01 mountd[5900]: can't change attributes for /usr/home/web01/swf    192.168.0.4
Dec  8 10:20:42 web01 mountd[5900]: bad exports list line /usr/home/web01/swf    192.168.0.4
</pre>
</li>
<li>
Restart service on the server. First stop, nfsd.</p>
<pre>/etc/rc.d/nfsd stop</pre>
<p>You have to make sure that mountd is stopped as well.</p>
<pre>/etc/rc.d/mountd forcestop</pre>
<p>Then kill rpcbind, I do this by finding the PID for rpcbind and killing it manually.</p>
<pre>ps aux|grep rpcbind</pre>
<p>It should return something like:</p>
<pre>root     6087  0.0  0.1  4776  1248  ??  Ss   10:28AM   0:00.01 rpcbind</pre>
<p>Then do the killing:</p>
<pre>kill -9 6087</pre>
<p>Then we start these processes in reverse order:</p>
<pre>
rpcbind
/etc/rc.d/nfsd start
</pre>
<p>Starting nfsd should start mountd as well.
</li>
<li>Verify your exports are properly listed
<pre>showmount -e</pre>
<p>Should give you something like:</p>
<pre>Exports list on localhost:
/usr/home/web01/images    192.168.0.4
/usr/home/web01/swf    192.168.0.4
</pre>
</li>
<li>Now if you use <code>hosts.allow</code> and <code>hosts.deny</code>, make sure that the NFS client is allowed on the NFS services. We have these on our <code>/etc/hosts.allow</code>
<pre>
nfs : 192.168.0.4 : allow
mountd : 192.168.0.4 : allow
rpcbind : 192.168.0.4 : allow
</pre>
</li>
<li>Now, before mounting on or CentOS client machine we verify first wether the NFS exports are visible:
<pre>rpcinfo -p 192.168.0.3</pre>
<p>You should get something like:</p>
<pre>
   program vers proto   port
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100000    4     7    111  portmapper
    100000    3     7    111  portmapper
    100000    2     7    111  portmapper
    100005    1   udp    861  mountd
    100005    3   udp    861  mountd
    100005    1   tcp    767  mountd
    100005    3   tcp    767  mountd
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
</pre>
</li>
<li>So, our exports are visible we can now mount those shares.
<pre>
mount -t nfs 192.168.0.3:/usr/home/web01/images /usr/home/web02/images
mount -t nfs 192.168.0.3:/usr/home/web01/swf /usr/home/web02/swf
</pre>
</li>
<li>That should do it, you should be able to see your mount points and browse files within them.</li>
</ol>
<p>Questions welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://dotmanila.com/blog/2008/12/freebsd-nfs-server-and-centos-nfs-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

