Setup and configure NFS on redhat

This entry was posted in Linux and tagged on June 17, 2012, by

What is NFS?

NFS stands for Network File System, a file system developed by Sun Microsystems, Inc. It is a client/server system that allows users to access files across a network and treat them as if they resided in a local file directory.

Consider following example

machine A :  server

machine B :  client

We want to share /data directory of machine A from machin B. Following is the procedure to follow

Configure the NFS server

Server: machine A.

1. Edit the /etc/exports file to share /data directory with read and write access.

# vi /etc/exports

/data     *(rw,sync)

Save and quit.

This will make /data directory as read write

2. Let NFS read the /etc/exports file for the new entry, and make /data available to the network with the exportfs command

# exportfs -a

3. Make sure the required nfs, nfslock, and portmap daemons are both running and configured to start after the next reboot.

# chkconfig portmap on

# chkconfig nfs on

# chkconfig nfslock on

# service nfs start

# service nfslock start

# service portmap start

 

After configuring server , next step is to configure NFS client

Configuring NFS client

1.Make sure the required netfs, nfslock, and portmap daemons are  running and configured to start after the next reboot.

# chkconfig netfs on

# chkconfig nfslock on

# chkconfig portmap on

# service netfs start

# service nfslock start

# service portmap start

2. Create a new /data directory on which you will mount server’s directory

# mkdir /data

# mount :/data /data

# ls -l /data

You can see that , you are able to share the contents of /data directory

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright 2017 ©Aceadmins. All rights reserved.