NFS

http://www.thegeekstuff.com/2010/10/nfs-mount-guide/

The /etc/exports file contains an entry for each directory that can be exported to NFS clients. This file is read automatically by the exportfs command. If you change this file, you must run the exportfs command before the changes can affect the way the daemon operates.

Only when this file is present during system startup does the rc.nfs script execute the exportfs command and start the nfsd and mountd daemons.

Edit the exports file vi /etc/exports and add:

/dir/to/export host2.mydomain.com(ro,root_squash)

The ro option mean mounting read-only. The root_squash option for not allowing root write access in this directory. For this change to take effect you will need to run the following command on your terminal:

/usr/sbin/exportfs -a

To export the the directory in read/write mode:

/u01/app/oracle *(rw,no_root_squash)

To export an NFS filesystem (via /etc/exports)

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

directory_to_be_exported       hostname(options)
/misc/export     speedy.redhat.com    # allow users from speedy.redhat.com to mount /misc/export with the default read-only permissions
/misc/export     speedy.redhat.com(rw)  # allow users from speedy.redhat.com to mount /misc/export with read and write privileges
/doNotDelete/ClinicalCafe *(rw,sync)      # allow users from * to mount with read and write privileges
/home/nfs/ 10.1.1.0/24(ro,sync)
/home/nfs/ 10.1.1.100(rw,sync) 10.1.1.10(ro,sync)
/home/nfs/ 10.1.1.100(rw,sync,no_root_squash)

Be careful with spaces in the /etc/exports file. If there are no spaces between the hostname and the options in parentheses, the options apply only to the hostname. If there is a space between the hostname and the options, the options apply to the rest of the world. For example, examine the following lines:

/misc/export speedy.redhat.com(rw)
/misc/export speedy.redhat.com (rw)

The first line grants users from speedy.redhat.com read-write access and denies all other users. The second line grants users from speedy.redhat.com read-only access (the default) and allows the rest of the world read-write access.

Each time you change /etc/exports, you must tell the NFS daemons to examine it for new information, or reload the configuration file:

/sbin/service nfs reload

To view the status of the NFS daemon

/sbin/service nfs status

To start the NFS daemon

/sbin/service nfs start

To stop the NFS daemon

/sbin/service nfs stop

To start the nfs service at boot time

/sbin/chkconfig --level 345 nfs on

To mount an NFS filesystem (via /etc/fstab)

nfs_fileserver_hostname_or_ip:/directory_being_exported /local_directory nfs defaults 0 0

After adding this line to /etc/fstab on the client system, type the command mount /local_directory at a shell prompt, and the mount point /local_directory will be mounted

To mount an NFS filesystem:

mount nfs_fileserver_hostname_or_ip:/directory_being_exported /local_directory
mount -t nfs -o nfsvers=3 10.1.1.200:/home/nfs /home/nfs_local

alternative to NFS
http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/custom-guide/s1-nfs-mount.html
http://nfs.sourceforge.net/nfs-howto/ar01s05.html
http://linux-ha.org/HaNFS

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License