{"id":3855,"date":"2022-12-20T17:20:16","date_gmt":"2022-12-20T20:20:16","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/exportfs-man8\/"},"modified":"2022-12-20T17:20:16","modified_gmt":"2022-12-20T20:20:16","slug":"exportfs-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/exportfs-man8\/","title":{"rendered":"exportfs (man8)"},"content":{"rendered":"<h1 align=\"center\">exportfs<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#CONFIGURATION FILE\">CONFIGURATION FILE<\/a><br \/> <a href=\"#DISCUSSION\">DISCUSSION<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#USAGE NOTES\">USAGE NOTES<\/a><br \/> <a href=\"#FILES\">FILES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHORS\">AUTHORS<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">exportfs \u2212 maintain table of exported NFS file systems<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\/usr\/sbin\/exportfs [-avi] [-o<\/b> <i>options,..<\/i><b>] [<\/b><i>client:\/path<\/i> <b>..] <br \/> \/usr\/sbin\/exportfs -r [-v] <br \/> \/usr\/sbin\/exportfs [-av] -u [<\/b><i>client:\/path<\/i> <b>..] <br \/> \/usr\/sbin\/exportfs [-v] <br \/> \/usr\/sbin\/exportfs -f <br \/> \/usr\/sbin\/exportfs -s<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">An NFS server maintains a table of local physical file systems that are accessible to NFS clients. Each file system in this table is referred to as an <i>exported file system<\/i>, or <i>export<\/i>, for short.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>exportfs<\/b> command maintains the current table of exports for the NFS server. The master export table is kept in a file named <i>\/var\/lib\/nfs\/etab<\/i>. This file is read by <b>rpc.mountd<\/b> when a client sends an NFS MOUNT request.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Normally the master export table is initialized with the contents of <i>\/etc\/exports<\/i> and files under <i>\/etc\/exports.d<\/i> by invoking <b>exportfs -a<\/b>. However, a system administrator can choose to add or delete exports without modifying <i>\/etc\/exports<\/i> or files under <i>\/etc\/exports.d<\/i> by using the <b>exportfs<\/b> command.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>exportfs<\/b> and its partner program <b>rpc.mountd<\/b> work in one of two modes: a legacy mode which applies to 2.4 and earlier versions of the Linux kernel, and a new mode which applies to 2.6 and later versions, providing the <b>nfsd<\/b> virtual filesystem has been mounted at <i>\/proc\/fs\/nfsd<\/i> or <i>\/proc\/fs\/nfs<\/i>. On 2.6 kernels, if this filesystem is not mounted, the legacy mode is used.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In the new mode, <b>exportfs<\/b> does not give any information to the kernel, but provides it only to <b>rpc.mountd<\/b> through the <i>\/var\/lib\/nfs\/etab<\/i> file. <b>rpc.mountd<\/b> then manages kernel requests for information about exports, as needed.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In the legacy mode, exports which identify a specific host, rather than a subnet or netgroup, are entered directly into the kernel\u2019s export table, as well as being written to <i>\/var\/lib\/nfs\/etab<\/i>. Further, exports listed in <i>\/var\/lib\/nfs\/rmtab<\/i> which match a non host-specific export request will cause an appropriate export entry for the host given in <i>rmtab<\/i> to be added to the kernel\u2019s export table.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212d kind or \u2212\u2212debug kind<\/b><\/p>\n<p style=\"margin-left:22%;\">Turn on debugging. Valid kinds are: all, auth, call, general and parse. Debugging can also be turned on by setting <b>debug=<\/b> in the <b>[exportfs]<\/b> section of <i>\/etc\/nfs.conf<\/i>.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>-a<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"53%\">\n<p>Export or unexport all directories.<\/p>\n<\/td>\n<td width=\"25%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>-o<\/b> <i>options,&#8230;<\/i><\/p>\n<p style=\"margin-left:22%;\">Specify a list of export options in the same manner as in <b>exports<\/b>(5).<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>-i<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Ignore the <i>\/etc\/exports<\/i> file and files under <i>\/etc\/exports.d<\/i> directory. Only default options and options given on the command line are used.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>-r<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Reexport all directories, synchronizing <i>\/var\/lib\/nfs\/etab<\/i> with <i>\/etc\/exports<\/i> and files under <i>\/etc\/exports.d<\/i>. This option removes entries in <i>\/var\/lib\/nfs\/etab<\/i> which have been deleted from <i>\/etc\/exports<\/i> or files under <i>\/etc\/exports.d<\/i>, and removes any entries from the kernel export table which are no longer valid.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>-u<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Unexport one or more directories.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>-f<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>If <i>\/proc\/fs\/nfsd<\/i> or <i>\/proc\/fs\/nfs<\/i> is mounted, flush everything out of the kernel\u2019s export table. Fresh entries for active clients are added to the kernel\u2019s export table by <b>rpc.mountd<\/b> when they make their next NFS mount request.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>-v<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Be verbose. When exporting or unexporting, show what\u2019s going on. When displaying the current export list, also display the list of export options.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>-s<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Display the current export list suitable for \/etc\/exports.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>CONFIGURATION FILE <a name=\"CONFIGURATION FILE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>[exportfs]<\/b> section of the <i>\/etc\/nfs.conf<\/i> configuration file can contain a <b>debug<\/b> value, which can be one or more from the list <b>general<\/b>, <b>call<\/b>, <b>auth<\/b>, <b>parse<\/b>, <b>all<\/b>. When a list is given, the members should be comma-separated.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>exportfs<\/b> will also recognize the <b>state-directory-path<\/b> value from the <b>[mountd]<\/b> section.<\/p>\n<h2>DISCUSSION <a name=\"DISCUSSION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Exporting Directories<\/b> <br \/> The first synopsis shows how to invoke <b>exportfs<\/b> when adding new entries to the export table. When using <b>exportfs -a<\/b>, all exports listed in <i>\/etc\/exports<\/i> and files under <i>\/etc\/exports.d<\/i> are added to <i>\/var\/lib\/nfs\/etab<\/i>. The kernel\u2019s export table is also updated as needed.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>host:\/path<\/i> argument specifies a local directory to export, along with the client or clients who are permitted to access it. See <b>exports(5)<\/b> for a description of supported options and access list formats.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">IPv6 presentation addresses contain colons, which are already used to separate the &#8220;host&#8221; and &#8220;path&#8221; command line arguments. When specifying a client using a raw IPv6 address, enclose the address in square brackets. For IPv6 network addresses, place the prefix just after the closing bracket.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">To export a directory to the world, simply specify <i>:\/path<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The export options for a particular host\/directory pair derive from several sources. The default export options are <b>sync,ro,root_squash,wdelay<\/b>. These can be overridden by entries in <i>\/etc\/exports<\/i> or files under <i>\/etc\/exports.d<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A system administrator may override options from these sources using the <b>-o<\/b> command-line option on <b>exportfs<\/b>. This option takes a comma-separated list of options in the same fashion as one would specify them in <i>\/etc\/exports<\/i>. In this way <b>exportfs<\/b> can be used to modify the export options of an already exported directory.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Unexporting Directories<\/b> <br \/> The third synopsis shows how to unexport a currently exported directory. When using <b>exportfs -ua<\/b>, all entries listed in <i>\/var\/lib\/nfs\/etab<\/i> are removed from the kernel export tables, and the file is cleared. This effectively shuts down all NFS activity.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">To remove an export, specify a <i>host:\/path<\/i> pair. This deletes the specified entry from <i>\/var\/lib\/nfs\/etab<\/i> and removes the corresponding kernel entry (if any).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Dumping the Export Table<\/b> <br \/> Invoking <b>exportfs<\/b> without options shows the current list of exported file systems. Adding the <b>-v<\/b> option causes <b>exportfs<\/b> to display the export options for each export.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following adds all directories listed in <i>\/etc\/exports<\/i> and files under <i>\/etc\/exports.d<\/i> to <i>\/var\/lib\/nfs\/etab<\/i> and pushes the resulting export entries into the kernel:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b># exportfs -a<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">To export the <i>\/usr\/tmp<\/i> directory to host <b>django<\/b>, allowing insecure file locking requests from clients:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b># exportfs -o insecure_locks django:\/usr\/tmp<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">To unexport the <i>\/usr\/tmp<\/i> directory:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b># exportfs -u django:\/usr\/tmp<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">To unexport all exports listed in <i>\/etc\/exports<\/i> and files under <i>\/etc\/exports.d<\/i>:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b># exportfs -au<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">To export the <i>\/usr\/tmp<\/i> directory to IPv6 link-local clients:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b># exportfs [fe80::]\/64:\/usr\/tmp<\/b><\/p>\n<h2>USAGE NOTES <a name=\"USAGE NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Exporting to IP networks or DNS and NIS domains does not enable clients from these groups to access NFS immediately. Rather, these sorts of exports are hints to <b>rpc.mountd<\/b>(8) to grant any mount requests from these clients. This is usually not a problem, because any existing mounts are preserved in <i>rmtab<\/i> across reboots.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When unexporting a network or domain entry, any current exports to members of this group will be checked against the remaining valid exports and if they themselves are no longer valid they will be removed.<\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"27%\">\n<p style=\"margin-top: 1em\"><i>\/etc\/exports<\/i><\/p>\n<\/td>\n<td width=\"11%\"><\/td>\n<td width=\"51%\">\n<p style=\"margin-top: 1em\">input file listing exports, export options, and access control lists<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"27%\">\n<p><i>\/etc\/exports.d<\/i><\/p>\n<\/td>\n<td width=\"11%\"><\/td>\n<td width=\"51%\">\n<p>directory where extra input files are stored. <b>Note:<\/b> only files that end with <i>.exports<\/i> are used.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"27%\">\n<p><i>\/var\/lib\/nfs\/etab<\/i><\/p>\n<\/td>\n<td width=\"11%\"><\/td>\n<td width=\"51%\">\n<p>master table of exports<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"27%\">\n<p><i>\/var\/lib\/nfs\/rmtab<\/i><\/p>\n<\/td>\n<td width=\"11%\"><\/td>\n<td width=\"51%\">\n<p>table of clients accessing server\u2019s exports<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>exports<\/b>(5), <b>nfs.conf<\/b>(5), <b>rpc.mountd<\/b>(8), <b>netgroup<\/b>(5)<\/p>\n<h2>AUTHORS <a name=\"AUTHORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Olaf Kirch <okir@monad.swb.de> <br \/> Neil Brown <neilb@cse.unsw.edu.au><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  exportfs \u2212 maintain table of exported NFS file systems <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,948,4],"class_list":["post-3855","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-exportfs","tag-man8"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3855","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3855"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3855\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}