Using exportfs to create temporary exports
It's not always desirable to create permanent exports within the /etc/exports
file. Should you want to define a new export temporarily, you can use the exportfs
command. As we have already defined the NFS root to be /var/exports
, all directories that we export must be after that structure. Let's temporarily export /var/export/doc
to all hosts. We can do so using the following command:
$ sudo exportfs *:/var/exports/doc
On the next restart of nfs-server
, this export will be lost; however, if you need to delete it ahead of this, you can implement the following command:
$ sudo exportfs -u *:/var/exports/doc
Should you need to include export options with the temporary export, use the -o
option in a similar ...
Get Learning RHEL Networking now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.