Linux: Exporting Directories via NFS

To export directories via NFS, perform the following steps (the following assumes that the central instance host is the NFS server):
1. Log on as user root to the NFS server.
2. Make sure that your host is configured as NFS server by making sure that the output of the command chkconfig –list nfs
looks like:
nfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
You can set up your host as NFS server using the command:
/etc/rc.d/init.d/nfs start
3. To export a directory from a local file system you can
− Use the tool linuxconf
− Perform the configuration manually
To perform the configuration manually:
a. Add a line to the local file /etc/exports:
#/etc/exports
<directory> <hostname>(<options>)

>

To export the directory /usr/sap/trans in read-only mode to the NFS client host.wdf.sap-ag.de:
#/etc/exports
/usr/sap/trans host.wdf.sap-ag.de(ro)
To export the directory in read-write mode:
#/etc/exports
/usr/sap/trans host.wdf.sap-ag.de(rw)
To export the directory to all NFS clients of the domain using a wildcard (*):
#/etc/exports
/usr/sap/trans *.wdf.sap-ag.de(rw)


There must not be a blank between hostname and options. Otherwise, the directory will be exported both read-only to hostname and in consideration of the options to everyone.

b. To activate the changes (that is, inform the NFS daemon about the changes performed in /etc/exports), enter:
exportfs -r
To get a list of all currently exported directories, enter
exportfs -v
For further details please consult the man page by entering man exports.
4. Log on as user root to the host where the file system should be imported.
5. Mount the file systems with:
mount <nfs_server>:<file_system> <mount_point>
mount <nfs_server>:/usr/sap/trans /usr/sap/trans

Leave a Comment

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

CAPTCHA * Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top