Friday, December 5, 2008

Configuring Network File System(NFS) :

Network File System(NFS):
A network file system is any computer file system that supports sharing of files, printers and other resources as persistent storage over a computer network. For this a NFS server is to be configured.

In this article i will show how to configure NFS in RHEL5.

Network File System

Purpose: File Sharing between same and diferent operating systems
specialyUnix based operating systems
Port: 2049 tcp/udp
Dependency: Portmap Service
Service Type: Standalone
User Account to Configure NFS: root

File Location:

Config File: /etc/exports
Status Dir: /var/lib/nfs
Status of exported/shared partitions: /var/lib/nfs/etab
Status of remotely mounted local partitions: /var/lib/nfs/rmtab
Startup scripts: /etc/rc.d/init.d/nfs
Executeable files: /usr/sbin/rpc.nfsd , /sbin/rpc.lockd
/usr/sbin/rpc.mountd, /sbin/rpc.statd

Configuration Steps:

Server Side Setings:

1. Configure portmap and nfs services to start at boot time

Command: chkconfig –level 35 portmap on
chkconfig –level 35 nfs on

2. Create /etc/exports file

File Contents (very basic): /data *

3. Start/Restart portmap and nfs services

Command: service portmap restart
service nfs restart

4. Check if directories shared properly or not

Command: showmount –e
cat/proc/fs/nfsd/exports

Client Side Setings:

1. Start/Restart portmap and nfs services:

Command: service portmap restart
service nfs restart

2. Check rpc status of NFS server:

Command: rpcinfo –p IP_OF_SERVER

3. Check shared directory list of server:

Command: showmount –e IP_OF_SERVER

4. Mount shared directory:

Command: mount IP_OR_NAME_OF_SERVER:/SHAR_DIR /LOCAL_SYSTEM_DIR

5. Umount shared directory:

Command: umount /LOCAL_SYSTEM_DIR

6. Configuring /etc/fstab file:

Add folowing at the end of the /etc/fstab file

IP_OF_SERVER:/SHARED_DIR /mnt nfsintr,bg,defaults 0 0

Checking command: mount –a

Special Settings:

/etc/exports Configuration Options (server):

rw : Alow write permissions
sync: Tels server to sync data on HD then reply client
no_root_squash: Client root user has root permissions (ful access) on shared
directory of server
anonuid: nfs server wil treat every access request with the permission of
specified user
anongid: nfs server wil treat every access request with the permission of
specified group

/etc/fstab Configuration Options (client):

intr: If client communication with server stops or if some problem occurs
then client system creates problems and some times becomes
unavailable to avoid this situation use this option.

soft: it can be used in place of intr. Soft option drops connection from the
server and do not let client system unavailable

bg: If we have added entry in /etc/fstab of client to mount a partition on
server and server is unavailable / down when client system boots this
option tels client system to boot normaly and try to mount later and
keep trying.

2 comments:

  1. Hope itz helpful...but need a lot of tym 2 read it!!!!!

    ReplyDelete
  2. take ur own time at let me know if u hav ny doubts.

    ReplyDelete