Activating Modifications to the /etc/exports File



Activating Modifications to the /etc/exports File

You can force your system to re-read the /etc/exports file by restarting NFS. In a nonproduction environment, this may cause disruptions when an exported directory suddenly disappears without prior notification to users. Here are some methods you can use to update and activate the file with the least amount of inconvenience to others.

New Exports File

When no directories have yet been exported to NFS, use the exportfs -a command:

     [root@bigboy tmp]# exportfs -a

Adding a Shared Directory To An Existing Exports File

When adding a shared directory, you can use the exportfs -r command to export only the new entries:

     [root@bigboy tmp]# exportfs -r

Deleting, Moving, or Modifying a Share

Removing an exported directory from the /etc/exports file requires work on both the NFS client and server. The steps are:

1.
Unexport the mount point directory on the NFS client using the umount command. In this case, you're unmounting the /mnt/nfs mount point:

[root@smallfry tmp]# umount /mnt/nfs

Note

You may also need to edit the /etc/fstab file of any entries related to the mount point if you want to make the change permanent even after rebooting.


2.
Comment out the corresponding entry in the NFS server's /etc/exports file and reload the modified file:

[root@bigboy tmp]# exportfs -ua
[root@bigboy tmp]# exportfs -a

You have now completed a seamless removal of the exported directory with much less chance of having critical errors.