Exporting a File System for NFS - (/etc/exports)
by Jeff Hunter, Sr. Database Administrator
This article presents the methods for preparing a set of directories that can be exported to NFS clients using Linux. Under Linux this is can be accomplished by editing the /etc/exports file.
For the purpose of this example, I will be exporting (sharing) the directory /mnt/software.
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 is the directory you want to export
host#.mydomain.com is the machine allowed to log in this directory
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:
How to export the the directory in read/write mode (not a good idea!):
Jeffrey Hunter is an Oracle Certified Professional, Java Development Certified Professional, Author, and an Oracle ACE. Jeff currently works as a Senior Database Administrator for The DBA Zone, Inc. located in Pittsburgh, Pennsylvania. His work includes advanced performance tuning, Java and PL/SQL programming, developing high availability solutions, capacity planning, database security, and physical / logical database design in a UNIX / Linux server environment. Jeff's other interests include mathematical encryption theory, tutoring advanced mathematics, programming language processors (compilers and interpreters) in Java and C, LDAP, writing web-based database administration tools, and of course Linux. He has been a Sr. Database Administrator and Software Engineer for over 20 years and maintains his own website site at: http://www.iDevelopment.info. Jeff graduated from Stanislaus State University in Turlock, California, with a Bachelor's degree in Computer Science and Mathematics.
Copyright (c) 1998-2014 Jeffrey M. Hunter. All rights reserved.
All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at firstname.lastname@example.org.
I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.
Last modified on
Friday, 29-Apr-2011 02:25:58 EDT
Page Count: 160141