<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pt-BR">
	<id>https://wiki.slacam.com.br/index.php?action=history&amp;feed=atom&amp;title=Configurando_NFS_no_Centos</id>
	<title>Configurando NFS no Centos - Histórico de revisão</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.slacam.com.br/index.php?action=history&amp;feed=atom&amp;title=Configurando_NFS_no_Centos"/>
	<link rel="alternate" type="text/html" href="https://wiki.slacam.com.br/index.php?title=Configurando_NFS_no_Centos&amp;action=history"/>
	<updated>2026-11-17T00:33:30Z</updated>
	<subtitle>Histórico de revisões para esta página neste wiki</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.slacam.com.br/index.php?title=Configurando_NFS_no_Centos&amp;diff=666&amp;oldid=prev</id>
		<title>Felipe em 10h46min de 19 de dezembro de 2013</title>
		<link rel="alternate" type="text/html" href="https://wiki.slacam.com.br/index.php?title=Configurando_NFS_no_Centos&amp;diff=666&amp;oldid=prev"/>
		<updated>2013-12-19T10:46:00Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;pt-BR&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Edição anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Edição das 10h46min de 19 de dezembro de 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Linha 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linha 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;ads media=goo5/&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Setting Up An NFS Server And Client On CentOS 6.3&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Setting Up An NFS Server And Client On CentOS 6.3&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l202&quot; &gt;Linha 202:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linha 203:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;192.168.0.100:/var/nfs on /mnt/nfs/var/nfs type nfs (rw,sync,hard,intr,vers=4,addr=192.168.0.100,clientaddr=192.168.0.101)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;192.168.0.100:/var/nfs on /mnt/nfs/var/nfs type nfs (rw,sync,hard,intr,vers=4,addr=192.168.0.100,clientaddr=192.168.0.101)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[root@client ~]#&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[root@client ~]#&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;ads media=goo3/&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Felipe</name></author>
	</entry>
	<entry>
		<id>https://wiki.slacam.com.br/index.php?title=Configurando_NFS_no_Centos&amp;diff=544&amp;oldid=prev</id>
		<title>Machado: Criou página com &#039;Setting Up An NFS Server And Client On CentOS 6.3    Version 1.0 Author: Falko Timme &lt;ft [at] falkotimme [dot] com&gt; Follow me on Twitter Last edited 12/11/2012  This guide exp...&#039;</title>
		<link rel="alternate" type="text/html" href="https://wiki.slacam.com.br/index.php?title=Configurando_NFS_no_Centos&amp;diff=544&amp;oldid=prev"/>
		<updated>2013-12-11T16:29:09Z</updated>

		<summary type="html">&lt;p&gt;Criou página com &amp;#039;Setting Up An NFS Server And Client On CentOS 6.3    Version 1.0 Author: Falko Timme &amp;lt;ft [at] falkotimme [dot] com&amp;gt; Follow me on Twitter Last edited 12/11/2012  This guide exp...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Setting Up An NFS Server And Client On CentOS 6.3&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Version 1.0&lt;br /&gt;
Author: Falko Timme &amp;lt;ft [at] falkotimme [dot] com&amp;gt;&lt;br /&gt;
Follow me on Twitter&lt;br /&gt;
Last edited 12/11/2012&lt;br /&gt;
&lt;br /&gt;
This guide explains how to set up an NFS server and an NFS client on CentOS 6.3. NFS stands for Network File System; through NFS, a client can access (read, write) a remote share on an NFS server as if it was on the local hard disk.&lt;br /&gt;
&lt;br /&gt;
I do not issue any guarantee that this will work for you!&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
1 Preliminary Note&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m using two CentOS systems here:&lt;br /&gt;
&lt;br /&gt;
NFS Server: server.example.com, IP address: 192.168.0.100&lt;br /&gt;
NFS Client: client.example.com, IP address: 192.168.0.101&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
2 Installing NFS&lt;br /&gt;
&lt;br /&gt;
server:&lt;br /&gt;
&lt;br /&gt;
On the NFS server we run:&lt;br /&gt;
&lt;br /&gt;
yum install nfs-utils nfs-utils-lib&lt;br /&gt;
&lt;br /&gt;
Then we create the system startup links for the NFS server and start it:&lt;br /&gt;
&lt;br /&gt;
chkconfig --levels 235 nfs on&lt;br /&gt;
/etc/init.d/nfs start&lt;br /&gt;
&lt;br /&gt;
client:&lt;br /&gt;
&lt;br /&gt;
On the client we can install NFS as follows (this is actually the same as on the server):&lt;br /&gt;
&lt;br /&gt;
yum install nfs-utils nfs-utils-lib&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
3 Exporting Directories On The Server&lt;br /&gt;
&lt;br /&gt;
server:&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;d like to make the directories /home and /var/nfs accessible to the client; therefore we must &amp;quot;export&amp;quot; them on the server.&lt;br /&gt;
&lt;br /&gt;
When a client accesses an NFS share, this normally happens as the user nobody. Usually the /home directory isn&amp;#039;t owned by nobody (and I don&amp;#039;t recommend to change its ownership to nobody!), and because we want to read and write on /home, we tell NFS that accesses should be made as root (if our /home share was read-only, this wouldn&amp;#039;t be necessary). The /var/nfs directory doesn&amp;#039;t exist, so we can create it and change its ownership; in my tests the user and group nobody both had the ID 99 on both my CentOS test systems (server and client); when I tried to write to /var/nfs from the NFS client, I got a Permission denied error, so I did a chmod 777 /var/nfs so that everyone could write to that directory; writing to /var/nfs from the client worked then, and on the client the files written to /var/nfs appeared to be owned by the user and group nobody, but on the server they were owned by the (nonexistant) user and group with the ID 65534; so I changed ownership of /var/nfs to the user/group 65534 on the server and changed permissions of /var/nfs back to 755, and voilà, the client was allowed to write to /var/nfs:&lt;br /&gt;
&lt;br /&gt;
mkdir /var/nfs&lt;br /&gt;
chown 65534:65534 /var/nfs&lt;br /&gt;
chmod 755 /var/nfs&lt;br /&gt;
&lt;br /&gt;
Now we must modify /etc/exports where we &amp;quot;export&amp;quot; our NFS shares. We specify /home and /var/nfs as NFS shares and tell NFS to make accesses to /home as root (to learn more about /etc/exports, its format and available options, take a look at&lt;br /&gt;
&lt;br /&gt;
man 5 exports&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
vi /etc/exports&lt;br /&gt;
&lt;br /&gt;
/home           192.168.0.101(rw,sync,no_root_squash,no_subtree_check)&lt;br /&gt;
/var/nfs        192.168.0.101(rw,sync,no_subtree_check)&lt;br /&gt;
&lt;br /&gt;
(The no_root_squash option makes that /home will be accessed as root.)&lt;br /&gt;
&lt;br /&gt;
Whenever we modify /etc/exports, we must run&lt;br /&gt;
&lt;br /&gt;
exportfs -a&lt;br /&gt;
&lt;br /&gt;
afterwards to make the changes effective.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
4 Mounting The NFS Shares On The Client&lt;br /&gt;
&lt;br /&gt;
client:&lt;br /&gt;
&lt;br /&gt;
First we create the directories where we want to mount the NFS shares, e.g.:&lt;br /&gt;
&lt;br /&gt;
mkdir -p /mnt/nfs/home&lt;br /&gt;
mkdir -p /mnt/nfs/var/nfs&lt;br /&gt;
&lt;br /&gt;
Afterwards, we can mount them as follows:&lt;br /&gt;
&lt;br /&gt;
mount 192.168.0.100:/home /mnt/nfs/home&lt;br /&gt;
mount 192.168.0.100:/var/nfs /mnt/nfs/var/nfs&lt;br /&gt;
&lt;br /&gt;
You should now see the two NFS shares in the outputs of&lt;br /&gt;
&lt;br /&gt;
df -h&lt;br /&gt;
&lt;br /&gt;
[root@client ~]# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/mapper/vg_server2-LogVol00&lt;br /&gt;
                      9.7G  1.7G  7.5G  18% /&lt;br /&gt;
tmpfs                 499M     0  499M   0% /dev/shm&lt;br /&gt;
/dev/sda1             504M   39M  440M   9% /boot&lt;br /&gt;
192.168.0.100:/home   9.7G  1.7G  7.5G  19% /mnt/nfs/home&lt;br /&gt;
192.168.0.100:/var/nfs&lt;br /&gt;
                      9.7G  1.7G  7.5G  19% /mnt/nfs/var/nfs&lt;br /&gt;
[root@client ~]#&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
mount&lt;br /&gt;
&lt;br /&gt;
[root@client ~]# mount&lt;br /&gt;
/dev/mapper/vg_server2-LogVol00 on / type ext4 (rw)&lt;br /&gt;
proc on /proc type proc (rw)&lt;br /&gt;
sysfs on /sys type sysfs (rw)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
/dev/sda1 on /boot type ext4 (rw)&lt;br /&gt;
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
192.168.0.100:/home on /mnt/nfs/home type nfs (rw,vers=4,addr=192.168.0.100,clientaddr=192.168.0.101)&lt;br /&gt;
192.168.0.100:/var/nfs on /mnt/nfs/var/nfs type nfs (rw,vers=4,addr=192.168.0.100,clientaddr=192.168.0.101)&lt;br /&gt;
[root@client ~]#&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
5 Testing&lt;br /&gt;
&lt;br /&gt;
On the client, you can now try to create test files on the NFS shares:&lt;br /&gt;
&lt;br /&gt;
client:&lt;br /&gt;
&lt;br /&gt;
touch /mnt/nfs/home/test.txt&lt;br /&gt;
touch /mnt/nfs/var/nfs/test.txt&lt;br /&gt;
&lt;br /&gt;
Now go to the server and check if you can see both test files:&lt;br /&gt;
&lt;br /&gt;
server:&lt;br /&gt;
&lt;br /&gt;
ls -l /home/&lt;br /&gt;
&lt;br /&gt;
[root@server ~]# ls -l /home/&lt;br /&gt;
total 0&lt;br /&gt;
-rw-r--r-- 1 root root 0 Dec 11 16:58 test.txt&lt;br /&gt;
[root@server ~]#&lt;br /&gt;
&lt;br /&gt;
ls -l /var/nfs&lt;br /&gt;
&lt;br /&gt;
[root@server ~]# ls -l /var/nfs&lt;br /&gt;
total 0&lt;br /&gt;
-rw-r--r-- 1 nfsnobody nfsnobody 0 Dec 11 16:58 test.txt&lt;br /&gt;
[root@server ~]#&lt;br /&gt;
&lt;br /&gt;
(Please note the different ownerships of the test files: the /home NFS share gets accessed as root, therefore /home/test.txt is owned by root; the /var/nfs share gets accessed as nobody/65534, therefore /var/nfs/test.txt is owned by 65534.)&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
6 Mounting NFS Shares At Boot Time&lt;br /&gt;
&lt;br /&gt;
Instead of mounting the NFS shares manually on the client, you could modify /etc/fstab so that the NFS shares get mounted automatically when the client boots.&lt;br /&gt;
&lt;br /&gt;
client:&lt;br /&gt;
&lt;br /&gt;
Open /etc/fstab and append the following lines:&lt;br /&gt;
&lt;br /&gt;
vi /etc/fstab&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
192.168.0.100:/home  /mnt/nfs/home   nfs      rw,sync,hard,intr  0     0&lt;br /&gt;
192.168.0.100:/var/nfs  /mnt/nfs/var/nfs   nfs      rw,sync,hard,intr  0     0&lt;br /&gt;
&lt;br /&gt;
Instead of rw,sync,hard,intr you can use different mount options. To learn more about available options, take a look at&lt;br /&gt;
&lt;br /&gt;
man nfs&lt;br /&gt;
&lt;br /&gt;
To test if your modified /etc/fstab is working, reboot the client:&lt;br /&gt;
&lt;br /&gt;
reboot&lt;br /&gt;
&lt;br /&gt;
After the reboot, you should find the two NFS shares in the outputs of&lt;br /&gt;
&lt;br /&gt;
df -h&lt;br /&gt;
&lt;br /&gt;
[root@client ~]# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/mapper/vg_server2-LogVol00&lt;br /&gt;
                      9.7G  1.7G  7.5G  18% /&lt;br /&gt;
tmpfs                 499M     0  499M   0% /dev/shm&lt;br /&gt;
/dev/sda1             504M   39M  440M   9% /boot&lt;br /&gt;
192.168.0.100:/home   9.7G  1.7G  7.5G  19% /mnt/nfs/home&lt;br /&gt;
192.168.0.100:/var/nfs&lt;br /&gt;
                      9.7G  1.7G  7.5G  19% /mnt/nfs/var/nfs&lt;br /&gt;
[root@client ~]#&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
mount&lt;br /&gt;
&lt;br /&gt;
[root@client ~]# mount&lt;br /&gt;
/dev/mapper/vg_server2-LogVol00 on / type ext4 (rw)&lt;br /&gt;
proc on /proc type proc (rw)&lt;br /&gt;
sysfs on /sys type sysfs (rw)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
/dev/sda1 on /boot type ext4 (rw)&lt;br /&gt;
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
192.168.0.100:/home on /mnt/nfs/home type nfs (rw,sync,hard,intr,vers=4,addr=192.168.0.100,clientaddr=192.168.0.101)&lt;br /&gt;
192.168.0.100:/var/nfs on /mnt/nfs/var/nfs type nfs (rw,sync,hard,intr,vers=4,addr=192.168.0.100,clientaddr=192.168.0.101)&lt;br /&gt;
[root@client ~]#&lt;/div&gt;</summary>
		<author><name>Machado</name></author>
	</entry>
</feed>