NFS Configuration


Network File System (NFS)

Sharing resources is an important task in networks. There are numerous ways are used to share the files and directories over the network. In the Linux Operating system, Network File System Server enables the user to share their files and directories within the network environment. To install Network File System (NFS), your system must satisfy the following requirements.

Minimum Requirements
1. Your system must be configured with YUM
2. IP Address Configuration.
You should configure both the Server and Client system. Here i am using Red Hat Enterprise Linux 6 Operating System. This tutorial is applicable to fedora and Red Hat Enterprise Linux 5 Operating systems too.
Server Configuration
1. Open Terminal in root user mode.
2. Check whether nfs is already installed on your system. If not install it using yum.

3.  Lets choose some files to share or create some files in a directory. Here i wish to create some files in the /tmp directory.
# mkdir /tmp/test01; cd /tmp/test01
# touch file1 file2 file3
4. Now you should configure a file.
# vi /etc/exports
and edit the file as like below. ( Here my server ip address is 192.10.10.1 )
# The directories and files are available to specified client system.
/tmp/test01 192.10.10.1(rw,sync)
#The directories and files are available to specified network
/tmp/test02 192.10.10.0(rw,sync)
# The directories and files are available to all
/tmp/test01 *(rw,sync)
Finally save and quit the file ( Esc + : +wq ).
5. Now activate the share and restart the services.

For Red Hat Enterprise Linux 6 Beta Operating System
# service nfs restart  - It enables the sevice temporarily
# chkconfig nfs on – It enables the service permanently
For Red Hat Enterprise Linux 5 Operating System
# service portmap restart – It enables the service temporarily
# chkconfig portmap on – It enables the service permanently
The Server Configuration is over and now configure the client system.
Client Confiruration
1. Open Terminal in root user mode.
2. Install nfs using yum. If it is installed already just leave it
#yum install nfs
3. Now restart the services
For Red Hat Enterprise Linux 6 Beta Operating System
# service nfs restart  - It enables the sevice temporarily
# chkconfig nfs on – It enables the service permanently
For Red Hat Enterprise Linux 5 Operating System
# service portmap restart – It enables the service temporarily
# chkconfig portmap on – It enables the service permanently
4. Create a directory for mounting the files.

5. Now you can access the files and directories in the server system.

6. To remove the mount use umount command or if you would like to mount the directories permanently, edit the fstab file in the configuration directory.

7. Edit fstab file as like in the below picture ( Here my server p address is 192.10.10.1 )

Then finally save and quit the file (Esc + : + wq )
8. Finally again restart the services of both network and nfs.
# service nfs restart
# service network restart
If you still struggling, lets check out the firewall settings. you can open the firewall setting using the setup command.



No comments:

Post a Comment