REDHAT 5 – NFS

Posted: September 7, 2010 in REDHAT 5 LinUX

Network File System (NFS)

Network File System (NFS) is a way to share files between machines on a network as if the files were located on the client’s local hard drive. Red Hat Linux can be both an NFS server and an NFS client, which means that it can export file systems to other systems and mount file systems exported from other machines.

Command Line Configuration

If you prefer editing configuration files using a text editor or if you do not have the X Window System installed, you can modify the configuration file directly.

The /etc/exports file controls what directories the NFS server exports. Its format is as follows:

directory hostname(options)

The only option that needs to be specified is one of sync or async (sync is recommended). If sync is specified, the server does not reply to requests before the changes made by the request are written to the disk.

For example:

/misc/export     speedy.example.com(sync)

would allow users from speedy.example.com to mount /misc/export with the default read-only permissions, but:

/misc/export     speedy.example.com(rw,sync)
would allow users from speedy.example.com to mount /misc/export with read/write

Each time you change /etc/exports, you must inform the NFS daemon of the change, or reload the configuration file with the following command:

/sbin/service nfs reload

Making NFS server Live:

Server side (Server IP 10.1.31.1):
1. Check nfs-utils is installed or not using
#yum list nfs-utils
2. Edit /etc/exports , add dir you want share with netrwork information and permision
# vi /etc/exports
/var/ftp/pub 10.1.0.0/16(rw,sync,no_root_squash)
3. Restart nfs service
# service nfs retstart
or
# service nfs reload
4. Check port & shared dir using
# rcpinfo -p
# export -v
# service portmap status

Client Side (Client IP : 10.1.0.0/16, eg 10.1.31.67):
1. mount shared nfs folder
# mount 10.1.31.3:/var/ftp/pub /mnt
2. Do static mount using /etc/fstab

# vi /etc/fstab
10.1.31.1:/var/ftp/pub /mnt nfs defaults 0 0

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s