Skip to main content
IBM  
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : Linux : Education - Tutorials
LPI certification 102 exam prep, Part 4
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
4. Setting up NFS
  


The /etc/exports file page 4 of 11


Probably the best way to understand the format of /etc/exports is to look at a quick example. Here's a simple /etc/exports file that I use on my NFS server:


# /etc/exports: NFS file systems being exported.  See exports(5).
/ 192.168.1.9(rw,no_root_squash)
/mnt/backup 192.168.1.9(rw,no_root_squash)

As you can see, the first line in my /etc/exports file is a comment. On the second line, I select my root ("/") filesystem for export. Note that while this exports everything under "/", it will not export any other local filesystem. For example, if my NFS server has a CD-ROM mounted at /mnt/cdrom, the contents of the CDROM will not be available unless they are exported explicitly in /etc/exports. Now, notice the third line in my /etc/exports file. On this line, I export /mnt/backup; as you might guess, /mnt/backup is on a separate filesystem from /, and it contains a backup of my system. Each line also has a "192.168.1.9(rw,no_root_squash)" on it. This information tells nfsd to only make these exports available to the NFS client with the IP address of 192.168.1.9. It also tells nfsd to make these filesystems writeable as well as readable by NFS client systems, and instructs the NFS server to allow the remote NFS client to allow a superuser account to have true "root" access to the filesystems.


Main menuSection menuFeedbackPreviousNext
Privacy Legal Contact