/etc/exports
file and by running the exportfs
command. In addition, you must start the NFS server.mount
command to mount the directories that your server exported.etc/exports
file. Suppose that you want to export the /home
directory, and you want to enable the host named LNBP75
to mount this file system for read and write operations. You can do so by adding the following entry to the /etc/exports
file:192.168.0.0
, you could change this line to/etc/exports
file has this general format:root
on the server, for example, what owner is that on the client?) Within the parentheses, commas separate the options. If a host is allowed both read and write access, and all IDs are to be mapped to the anonymous user (by default, the anonymous user is named nobody
), the options look like this:/etc/exports
file. You find two types of options: general options and user ID mapping options.Option | Description |
General Options | |
secure | Allows connections only from port 1024 or lower (default) |
insecure | Allows connections from port 1024 or higher |
ro | Allows read-only access (default) |
rw | Allows both read and write access |
sync | Performs write operations (writing information to the disk) when requested (by default) |
async | Performs write operations when the server is ready |
no_wdelay | Performs write operations immediately |
wdelay | Waits a bit to see whether related write requests arrive and then performs them together (by default) |
hide | Hides an exported directory that’s a subdirectory of another exported directory (by default) |
no_hide | Causes a directory to not be hidden (opposite of hide) |
subtree_check | Performs subtree checking, which involves checking parent directories of an exported subdirectory whenever a file is accessed (by default) |
no_subtree_check | Turns off subtree checking (opposite of subtree_check) |
insecure_locks | Allows insecure file locking |
User ID Mapping Options | |
all_squash | Maps all user IDs and group IDs to the anonymous user on the client |
no_all_squash | Maps remote user and group IDs to similar IDs on the client (by default) |
root_squash | Maps remote root user to the anonymous user on the client (by default) |
no_root_squash | Maps remote root user to the local root user |
anonuid=UID | Sets the user ID of anonymous user to be used for the all_squash and root_squash options |
anongid=GID | Sets the group ID of anonymous user to be used for the all_squash and root_squash options |
/etc/exports
file, manually export the file system by typing the following command in a terminal window:/etc/exports
file.root
and typing /etc/init.d/nfs-kernel-server start in a terminal window. In Fedora, type /etc/init.d/nfs start. In SUSE, type /etc/init.d/nfsserver start. If you want the NFS server to start when the system boots, type update-rc.d nfs-kernel-server defaults in Debian. In Fedora, type chkconfig – -level 35 nfs on. In SUSE, type chkconfig – -level 35 nfsserver on./etc/exports
file, remember to restart
the NFS service. To restart a service, invoke the script in the /etc/init.d
directory with restart as the argument (instead of the start
argument that you use to start the service)./home
directory exported from the server named LNBP200
at the local directory /mnt/lnbp200
on the client system. To do so, follow these steps:root
, and create the directory with this command:LNBP200
) on the local directory/mnt/lnbp200
:/mnt/lnbp200
.root
on the client system, and type mount in a terminal window. You see a line similar to the following about the NFS file system:-o soft
option to the mount
command. For a soft mount, the client returns an error if the NFS server fails to respond and doesn’t retry.