Linux – How should I install NFS on a linux system

linuxnfsredhat

I have two systems and I need to setup a folder on one of them that is completely read/write-able by the other.

Questions:
1) How do I setup NFS on the server(s)? It is not installed as an available filesystem/module.
2) Where should I place this folder / what is the conventional place for locating such shared folders?

This is a RHEL5 system.


Error with setting up NFS.

This is what I did on server1 on which I want to share a local folder with server0

  1. In /etc/exports , I added
    /home/els1-share 199.199.82.98(rw,sync)

  2. mkdir /home/els1-share

  3. Enabled nfs and portmap through
    ntsysv

  4. Started services:

/etc/init.d/portmap start
Starting portmap: [ OK ]

/etc/init.d/nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]

Now, on server0, I did
1. mkdir /home/els1-share
2. mount 199.199.82.130:/home/els1-share /home/els1-share

which timed out with:
mount: mount to NFS server '199.199.82.130' failed: System Error: Connection timed out.

The IP addresses have been obfuscated, otherwise the output is exact.

Best Answer

yum -y install nfs-utils portmap

Prepare and modify /etc/exports for sharing files, that would similar to as shown below

/home/NFS-files 192.168.100.0/24(ro,sync)

/home/NFS-share */26(rw,sync)

/ISO 192.168.100.0/24(ro,sync)

service portmap start

service nfs start