ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/exportfs.htm

382 lines
21 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Change NFS Export (EXPORTFS)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body bgcolor="white">
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<a name="EXPORTFS.Top_Of_Page"></a>
<h2>Change NFS Export (EXPORTFS)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>No
</td>
<td valign="top" align="right">
<a href="#EXPORTFS.PARAMETERS.TABLE">Parameters</a><br>
<a href="#EXPORTFS.COMMAND.EXAMPLES">Examples</a><br>
<a href="#EXPORTFS.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="EXPORTFS"></a>
<p>The Change Network File System Export (EXPORTFS) command adds directory names to (exports) or removes directory names from (unexports) the list of directory trees that are currently exported to Network File System (NFS) clients. The flags in the OPTIONS list indicate what actions the EXPORTFS command should perform.
</p>
<p>A list of directories and options for exporting the directory and its contents is stored in the <i>/etc/exports</i> file. The EXPORTFS command allows the user to export all of the directory trees specified in the <i>/etc/exports</i> file using the -A flag, or to export a single directory tree by specifying the directory name. When the directory tree to be exported exists in the <i>/etc/exports</i> file, the user can export it with the options specified there, or one can use the -I flag to override the options, specifying the new options on the EXPORTFS command.
</p>
<p>Ths user can also export a directory tree not previously defined in the <i>/etc/exports</i> file by providing the options for it on the EXPORTFS command. The user can unexport directory trees by using the -U flag on the EXPORTFS command.
</p>
<p>The user can also add, change, or remove export entries in the <i>/etc/exports</i> file by using the -F flag.
</p>
<p>This command can also be issued using the following alternative command name:
</p>
<ul>
<li>CHGNFSEXP
</li>
</ul>
<p>For more information about Network File System commands, see the Network File System book, SC41-5714.
</p>
<p><b>Restrictions:</b>
</p>
<ol>
<li>The user must have input/output (I/O) system configuration (*IOSYSCFG) special authority to use this command.
</li>
<li>The user must have execute (*X) authority to each directory in the path name prefixes.
</li>
<li>When the -F flag is specified and the <i>/etc/exports</i> file does not exist, the user must have write, execute (*WX) authority to the <i>/etc</i> directory.
</li>
<li>When the -F flag is specified and the <i>/etc/exports</i> file does exist, the user must have read, write (*RW) authority to the <i>/etc/exports</i> file and *X authority to the <i>/etc</i> directory.
</li>
<li>Mixed CCSID encoding schemes are not supported. Specified CCSIDs must be single-byte character set (SBCS) or pure double-byte character set (DBCS).
</li>
</ol>
</div>
<table width="100%">
<tr><td align="right"><a href="#EXPORTFS.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="EXPORTFS.PARAMETERS.TABLE">Parameters</a></h3>
<table border="1" cellpadding="4" cellspacing="0">
<!-- col1="10" col2="15" col3="30" col4="10" -->
<tr>
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
</tr>
<tr>
<td valign="top"><a href="#EXPORTFS.OPTIONS"><b>OPTIONS</b></a></td>
<td valign="top">NFS export options</td>
<td valign="top"><i>Character value</i>, <b><u>*DFT</u></b></td>
<td valign="top">Optional, Positional 1</td>
</tr>
<tr>
<td valign="top"><a href="#EXPORTFS.DIR"><b>DIR</b></a></td>
<td valign="top">Directory</td>
<td valign="top"><i>Path name</i></td>
<td valign="top">Optional, Positional 2</td>
</tr>
<tr>
<td valign="top" rowspan="5"><a href="#EXPORTFS.HOSTOPT"><b>HOSTOPT</b></a></td>
<td valign="top">Host options</td>
<td valign="top">Single values: <b><u>*DFT</u></b><br>Other values (up to 10 repetitions): <i>Element list</i></td>
<td valign="top" rowspan="5">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Host name</td>
<td valign="top">
<i>Character value</i></td>
</tr>
<tr>
<td valign="top">Element 2: Data file CCSID</td>
<td valign="top">
0-65535, <b><u>*BINARY</u></b>, *ASCII, *JOBCCSID</td>
</tr>
<tr>
<td valign="top">Element 3: Path name CCSID</td>
<td valign="top">
0-65535, <b><u>*ASCII</u></b>, *JOBCCSID</td>
</tr>
<tr>
<td valign="top">Element 4: Force synchronous write</td>
<td valign="top">
<b><u>*SYNC</u></b>, *ASYNC</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#EXPORTFS.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="EXPORTFS.OPTIONS"></a>
<h3>NFS export options (OPTIONS)</h3>
<p>The export options list contains some flags followed optionally by a list containing a character string of characteristics for the directory tree to be exported.
</p>
<p>Each flag consists of a minus "-" followed by a character. The flags are separated by spaces. Only certain combinations of flags are allowed. If an invalid combination is detected, an error is returned.
</p>
<p>
<b>Note: </b>A value (other than *NONE) must be specified for either the OPTIONS or <b>Directory (DIR)</b> parameter. Both OPTIONS and DIR can be specified so long as '-A' is not part of the options list specified for the OPTIONS parameter.
</p>
<dl>
<dt><b><u>*DFT</u></b></dt>
<dd>The default value for the options string is:
<p>
<pre>
'-A'
</pre>
</p>
</dd>
<dt><b><i>options-flags</i></b></dt>
<dd>
<dl>
<dt><b>-A</b></dt>
<dd>This is the "all" flag and it indicates that all entries in the <i>/etc/exports</i> file are to be processed. The following flag combinations have special significance:
<dl>
<dt><b>-A and not -U</b></dt>
<dd>This will export every entry in the <i>/etc/exports</i> file (making them available to NFS clients).
</dd>
<dt><b>-A and -U</b></dt>
<dd>This will unexport every entry that is currently exported (making them unavailable to NFS clients). This makes no reference to the contents of the <i>/etc/exports</i> file.
</dd>
<dt><b>-A and the DIR parameter</b></dt>
<dd>This combination is not allowed.
</dd>
<dt><b>-A and (-I or -F or -O)</b></dt>
<dd>These combinations are not allowed.
</dd>
</dl>
</dd>
<dt><b>-I</b></dt>
<dd>This is the "ignore" flag and it indicates, for the directory tree specified in the DIR parameter, how the export characteristics are determined. The following flag combinations have special significance:
<dl>
<dt><b>-I and -O</b></dt>
<dd>The export characteristics specified on the -O flag are used, and the definitions listed in the <i>/etc/exports</i>, if they exist, are ignored.
</dd>
<dt><b>not -I and not -O</b></dt>
<dd>Either the export characteristics listed for the entry in the <i>/etc/exports</i> file are used, or, if there are no options in that file, the default options are assumed. See the -O flag description for the list of default options.
</dd>
<dt><b>-I and (-A or -U)</b></dt>
<dd>These combinations are not allowed.
</dd>
</dl>
</dd>
<dt><b>-U</b></dt>
<dd>This is the "unexport" flag and it indicates that the specified directory tree entered in the DIR parameter is to be unexported (made unavailable to NFS clients). The following flag combinations have special significance:
<dl>
<dt><b>-U and -A</b></dt>
<dd>This will unexport every entry that is currently exported (making them unavailable to NFS clients). This makes no reference to the contents of the <i>/etc/exports</i> file.
</dd>
<dt><b>-U and -F</b></dt>
<dd>The entry referenced in the DIR parameter is removed from the <i>/etc/exports</i> file (if it exists) in addition to being unexported (making it unavailable to NFS clients).
</dd>
<dt><b>-U and (-I or -O)</b></dt>
<dd>These combinations are not allowed.
</dd>
</dl>
</dd>
<dt><b>-F</b></dt>
<dd>This is the "file" flag and it requires the DIR parameter. The following flag combinations have special significance:
<dl>
<dt><b>-F and -U</b></dt>
<dd>The entry referenced in the DIR parameter is removed from the <i>/etc/exports</i> file (if it exists) in addition to being unexported (making it unavailable to NFS clients).
</dd>
<dt><b>-F and not -U and not -O</b></dt>
<dd>The specified directory tree entered in the DIR parameter is to be exported (made available to NFS clients). In addition, an entry for this directory tree entered in the DIR parameter will be added to the <i>/etc/exports</i> file. If the entry already exists in the file, it will be replaced with this new export entry. If the file does not exist, it will be created and the export entry will be added to it. Note that the "ignore" flag -I is implied when the "file" flag -F is specified without the "unexport" flag -U. Since the "options" flag -O is not specified, the default options are assumed. See the -O flag description for the list of default options.
</dd>
<dt><b>-F and not -U and -O</b></dt>
<dd>The specified directory tree entered in the DIR parameter is to be exported (made available to NFS clients). In addition, an entry for this directory tree entered in the DIR parameter will be added to the <i>/etc/exports</i> file. If the entry already exists in the file, it will be replaced with this new export entry. If the file does not exist, it will be created and the export entry will be added to it. Note that the "ignore" flag -I is implied when the "file" flag -F is specified without the "unexport" flag -U. All export characteristic options provided with the "options" flag -O are stored in the <i>/etc/exports</i> file as given on the command.
</dd>
<dt><b>-F and -A</b></dt>
<dd>This combination is not allowed.
</dd>
</dl>
<p>
<b>Note: </b>Successful use of the -F flag will cause the contents of the <i>/etc/exports</i> file to be replaced completely such that it reflects the changes, additions, or deletions caused by the -F flag. Any unrelated existing entries are copied, however ALL comments in the <i>/etc/exports</i> file will be lost as a result of using the -F flag.
</p>
</dd>
<dt><b>-E</b></dt>
<dd>This is the "escape message" flag and it indicates that an escape message should be issued if the command fails for any of the exports attempted.
</dd>
<dt><b>-O</b></dt>
<dd>This flag specifies the export characteristics for the directory tree that is to be exported (made available to NFS clients). The options list following the -O flag list consists of options separated by commas. Some options are followed by an equal '=' and a value (or list of values separated by colons ':'). The options list may contain spaces. If an option is not specified, the default value for that option will be used. The -O flag is only valid when either the "ignore" flag -I or the "file" flag -F is specified.
<p>If options are required and the -O flag is not specified, the following are the default options.
</p>
<ul>
<li>'RW=' All host names have read-write access to the directory tree.
</li>
<li>ANON=UID associated with the profile <i>QNFSANON</i>.
</li>
<li>Requests to bits in the mode other than the permission bits are allowed.
</li>
<li>'ROOT=' Root access is not allowed for any hosts.
</li>
<li>'ACCESS=' All clients are allowed to mount the directory.
</li>
</ul>
<p>The following are the available options and their descriptions.
</p>
<dl>
<dt><b>RO</b></dt>
<dd>Specifies the protection for the exported directory tree. If RO is specified, the directory tree is exported allowing only read-only access to the directory and its contents. If it is not specified, read-write access is allowed to the directory and its contents.
</dd>
<dt><b>RW=[HOSTNAME[:HOSTNAME]](...)</b></dt>
<dd>Specifies the host name or host names which will be allowed read-write access to the exported directory and its contents. For host names not specified, the directory and its contents will be exported allowing only read-only access.
<p>If neither RO or RW is specified, then 'RW=' is assumed, and all host names have read-write access to the exported directory.
</p>
</dd>
<dt><b>ANON=UID</b></dt>
<dd>If a request comes in from an unknown user, use this UID as the effective userid. Note that root users are considered unknown, unless specified on the ROOT option below. The default value for this option is the UID associated with the user profile <i>QNFSANON</i>.
<p>If the user does not want to allow any requests from unknown users, use 'ANON=-1'.
</p>
</dd>
<dt><b>NOSUID</b></dt>
<dd>Specifies that any attempt by the client to enable bits other than the permission bits will be ignored. If this option is not specified, attempt to set bits other than the permission bits will be carried out.
</dd>
<dt><b>ROOT=[HOSTNAME[:HOSTNAME]](...)</b></dt>
<dd>Specifies the host name or host names for which root access is allowed to the exported directory tree. If root access is allowed for a host, an incoming UID of 0 is mapped to the user profile QSECOFR, and incoming requests from users with all object (*ALLOBJ) special authority are allowed. If root access is not allowed for a host, an incoming UID of 0 and incoming requests from users with *ALLOBJ special authority are mapped to the UID provided in the ANON option. If the ROOT option is not specified, no hosts will be granted root access.
</dd>
<dt><b>ACCESS=[CLIENT[:CLIENT]](...)</b></dt>
<dd>Specifies the client or clients that are allowed to mount the exported directory tree. A client can be a host name or a netgroup. If no clients are specified, all clients will be allowed to mount the directory tree.
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#EXPORTFS.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="EXPORTFS.DIR"></a>
<h3>Directory (DIR)</h3>
<p>Specifies the absolute path name of the existing directory to be exported (made available to NFS clients) or unexported (made unavailable to NFS clients). This directory can not be a subdirectory or a parent of an already exported directory (unless it is in a different file system). This parameter is not allowed when the -A flag is specified on the <b>NFS export options (OPTIONS)</b> parameter. This parameter is required when the -F flag is specified on the OPTIONS parameter.
</p>
<p>
<b>Note: </b>A value (other than *NONE) must be specified for either the OPTIONS or DIR parameter. Both OPTIONS and DIR can be specified so long as '-A' is not part of the options list specified for the OPTIONS parameter.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#EXPORTFS.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="EXPORTFS.HOSTOPT"></a>
<h3>Host name (HOSTOPT)</h3>
<p>The HOSTOPT parameter has four elements that specify additional information about the NFS clients that a directory tree is to be exported to. If the HOSTOPT parameter is not specified for a host name the user is exporting the directory tree to, the defaults for each of the elements of the HOSTOPT parameter are assumed for that host.
</p>
<dl>
<dt><b><u>*DFT</u></b></dt>
<dd>*DFT specifies that the default values for the elements of the HOSTOPT parameter are used for all clients to which the directory tree or directory trees are to be exported. The network data file coded character set identifier (CCSID) is *BINARY, the network path name CCSID is *ASCII, and Force synchronous write is *SYNC.
<p><b>Element 1: Host name </b>
</p>
<p>The name of the host for which additional options are to be specified. This host should be specified above in the OPTIONS -O list as a host that has access to the exported directory tree. Specify either a single host name that is an alias for an address of a single host or a netgroup name to be associated with these options.
</p>
<p>The user can assign names to an internet address with the Work with TCP/IP host table entries option on the Configure TCP/IP menu (CFGTCP) command or via the i5/OS iSeries Navigator graphical user interface. Also, a remote name server can be used to map remote system names to internet addresses.
</p>
<p><b>Element 2: Network data file coded character set identifier (CCSID)</b>
</p>
<p>The network data file CCSID is used for data of the files sent and received from the specified HOST NAME (or netgroup name). For any hosts not specified on a HOSTOPT parameter, the default network data file CCSID (*BINARY) is used. The CCSID may be one of the following:
</p>
</dd>
<dt><b><u>*BINARY</u></b></dt>
<dd>The default network data file CCSID (binary, no conversion) is used.
</dd>
<dt><b>*ASCII</b></dt>
<dd>The ASCII equivalent of the default job CCSID associated with the current job is used.
</dd>
<dt><b>*JOBCCSID</b></dt>
<dd>The CCSID obtained from the default job CCSID is used.
</dd>
<dt><b><i>1-65533</i></b></dt>
<dd>Specify a CCSID for data files.
<p><b>Element 3: Network path name coded character set identifier (CCSID)</b>
</p>
<p>The network path name CCSID is used for the path name components of the files sent to and received from the specified HOST NAME (or netgroup name). For any hosts not specified on a HOSTOPT parameter, the default network path name CCSID (*ASCII) is used. The CCSID may be one of the following:
</p>
</dd>
<dt><b><u>*ASCII</u></b></dt>
<dd>The ASCII equivalent of the default job CCSID associated with the current job is used.
</dd>
<dt><b>*JOBCCSID</b></dt>
<dd>The CCSID obtained from the default job CCSID is used.
</dd>
<dt><b><i>1-65533</i></b></dt>
<dd>Specify a CCSID for path name components of files. Only code pages whose CCSIDs can be converted into UCS-2 level 1 (1200) are supported. See Globalization information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter for a list of supported conversions.
<p><b>Element 4: Write mode </b>
</p>
<p>Specifies whether write requests are handled synchronously or asynchronously for this HOST NAME (or netgroup name). The default value of *SYNC means that data will be written to disk immediately. *ASYNC does not guarantee that data is written to disk immediately, and can be used to improve server performance.
</p>
<p>
<b>Note: </b>The Network File System (NFS) protocol has traditionally used synchronous writes.
</p>
</dd>
<dt><b><u>*SYNC</u></b></dt>
<dd>Write requests are performed synchronously.
</dd>
<dt><b>*ASYNC</b></dt>
<dd>Write requests are performed asynchronously.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#EXPORTFS.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="EXPORTFS.COMMAND.EXAMPLES">Examples</a> </h3>
<p>The alternative command name for EXPORTFS is CHGNFSEXP. The following examples use the alternative command name, but EXPORTFS can be replaced directly for CHGNFSEXP in all of them.
</p>
<p><b>Example 1: Exporting All Entries from /etc/exports</b>
</p>
<p>
<pre>
CHGNFSEXP OPTIONS('-A')
-or-
CHGNFSEXP '-A'
</pre>
</p>
<p>Both of these commands export all entries that exist in the <i>/etc/exports</i> file.
</p>
<p><b>Example 2: Exporting One Directory with Options</b>
</p>
<p>
<pre>
CHGNFSEXP '-I -O RO,ANON=guest1,ACCESS=Roch1:9.7.431.2'
'/programs/public' HOSTOPT((MIAMI1 850 850))
</pre>
</p>
<p>This command exports the directory tree under the path name <i>/programs/public</i> as read-only. It allows only two clients to mount this directory tree. It takes advantage of the positional parameters OPTIONS and DIR. It uses the HOSTOPT parameter to specify coded character set identifier (CCSID) for the host MIAMI1.
</p>
<p><b>Example 3: Exporting One Directory with Options and Updating the /etc/exports File.</b>
</p>
<p>
<pre>
CHGNFSEXP '-I -F -O RO,ANON=guest1,ACCESS=Roch1:9.7.431.2'
'/programs/public' HOSTOPT((MIAMI1 850 850))
</pre>
</p>
<p>This command exports the directory tree under the path name <i>/programs/public</i> as read-only. It allows only two clients to mount this directory tree. The OPTIONS parameter value is specified positionally. It uses the HOSTOPT parameter to specify data and path name coded character set identifiers (CCSIDs) of 850 for host name MIAMI1.
</p>
<p>In addition, it also adds an export entry for <i>/programs/public</i>, along with the OPTIONS and HOSTOPT parameter values, to the <i>/etc/exports</i> file.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#EXPORTFS.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="EXPORTFS.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CPFA1B8</b></dt>
<dd>*IOSYSCFG authority required to use &amp;1.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#EXPORTFS.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>