Add Mounted FS (ADDMFS)

The Add Mounted File System (ADDMFS) command makes the objects in a file system accessible to the integrated file system name space. The file system to be made accessible can be either a user-defined file system (*UDFS) on the local system or a remote file system accessed through a local Network File System client (*NFS). The directory that is the destination for the mount, the Directory to mount over (MNTOVRDIR) parameter, must exist.

This command can also be issued using the following alternative command name:

For more information about Network File System commands, see i5/OS Network File System Support book, SC41-5714

Restrictions:

Parameters

Keyword Description Choices Notes
TYPE Type of file system *NFS, *UDFS Required, Key, Positional 1
MFS File system to mount Path name Required, Key, Positional 2
MNTOVRDIR Directory to mount over Path name Required, Key, Positional 3
OPTIONS Mount options Character value, *DFT Optional
CCSID Coded character set ID Element list Optional
Element 1: Data file CCSID 1-65533, *ASCII, *JOBCCSID, *BINARY
Element 2: Path name CCSID 1-65533, *ASCII, *JOBCCSID
CODEPAGE Code page Element list Optional
Element 1: Data file code page 1-32767, *ASCII, *JOBCCSID, *BINARY
Element 2: Path name code page 1-32767, *ASCII, *JOBCCSID

Type of file system (TYPE)

Specifies the type of file system to be mounted. The type of mount determines the correct form for the File system to mount (MFS) parameter.

*NFS
The file system specified for the MFS parameter is a Network File System. The MFS parameter must be of the form hostname:pathname where hostname can either be the name of a system or an IP address, and pathname must be an absolute path name.
*UDFS
The file system specified for the MFS parameter is a user-defined file system. The MFS parameter must be in one of the following forms:
  • /dev/qaspXX/udfsname.udfs where XX is one of the valid system or basic user auxiliary storage pool (ASP) numbers on the system, and udfsname is the name of the user-defined file system. All other parts of the name must appear as in the example above.
  • /dev/aspname/udfsname.udfs, where aspname is one of the valid independent ASP names on the system, and udfsname is the name of the user-defined file system. All other parts of the name must appear as in the example above.
  • /dev/QASP01/udfsname.tmpudfs, where udfsname is the name of the user-defined file system. Because the name ends with '.tmpudfs', all objects created in the file system will be temporary objects that will be deleted when the file system is unmounted, the system is restarted, or the Reclaim Storage (RCLSTG) command is used. Because temporary user-defined file systems only exist in the system ASP, 'QASP01' must be specified as the ASP name.

The name part of the path must be unique within the specified qaspXX or aspname directory.

This is a required parameter.

File system to mount (MFS)

Specifies the path name of the file system to be mounted. It can be the path to a local Block Special File (*BLKSF) or a remote NFS path name. See the Type of file system (TYPE) parameter to determine the correct format for the MFS parameter.

This is a required parameter.

Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.

Directory to mount over (MNTOVRDIR)

Specifies the path name of the existing directory that the file system will be mounted over. This directory gets 'covered' by the mounted file system. This directory must exist.

Multiple file systems can be mounted over the same directory, one on top of the other. However, only the topmost mounted file system is accessible, and the file systems must later be unmounted in the opposite order from which they were mounted (last-in first-out order).

This is a required parameter.

Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.

Mount options (OPTIONS)

The options list contains a character string of mount options. The options are separated by commas. For some options, an equal '=' and a value follow the option. If an option is not specified, the default value for that option will be used. The options list may contain spaces.

*DFT
The default value for the options string for the mount of a Network File System (*NFS) is:

'rw,suid,retry=5,rsize=32768,wsize=32768,timeo=20,retrans=5,
acregmin=30,acregmax=60,acdirmin=30,acdirmax=60,hard,async,sec=sys,
vers=3:2,cachetimeo=60,nocache'

The default value for the options string for the mount of a user-defined file system (*UDFS) is:

'rw,suid'

For the mount of a Network File System, all of the following options are valid. For the mount of a user-defined file system, only the ro, rw, suid and nosuid options are valid. If options are specified that are not valid for the file system type to be mounted, they are ignored.

options-list
The following are the available options and their descriptions:
rw|ro
This option specifies the protection for the mounted file system. Either ro (read-only) or rw (read-write) may be specified. If neither is specified, rw is assumed. Only rw may be specified for temporary user-defined file systems.
suid|nosuid
For the mount of a user-defined file system or a Network File System, if suid is specified, setuid execution is allowed. This means that bits other than the permission bits may be set. If nosuid is specified, setuid execution is not allowed.
hard|soft
For the mount of a Network File System, specifies whether NFS file systems are hard or soft mounted. Hard mounted means that operations on them are retried until they are acknowledged by the server. Soft mounted means that a timeout error is returned if a remote operation fails the number of times specified on the retrans option. If neither is specified, hard is assumed.
rsize=n
For the mount of a Network File System, specifies the size of the read buffer in bytes. The read buffer is used for data transfer between the NFS client and the remote NFS server on an NFS read request. The allowed range is 512 to 32768. If rsize is not specified, the default value of 32768 is assumed. For better performance, the read buffer should be a multiple of the the application buffer size.
wsize=n
For the mount of a Network File System, specifies the size of the write buffer in bytes. The write buffer is used for data transfer between the NFS client and the remote NFS server on an NFS write request. The allowed range is 512 to 32768. If wsize is not specified, the default value of 32768 is assumed. For better performance, the write buffer should be a multiple of the application buffer size.
timeo=n
For the mount of a Network File System, specifies the amount of time, in tenths of seconds, to wait for the client to respond on each try. The allowed range is 0 to 10000. If timeo is not specified, the default value of 20 tenths of a second (2 seconds) is assumed.
retry=n
For the mount of a Network File System, specifies the number of times to retry the mount operation. The allowed range is 0 to 10000. If retry is not specified, the default value of 5 retransmission attempts is assumed.
retrans=n
For the mount of a Network File System, specifies the number of times to retry the transmission to the server. The allowed range is 0 to 10. If retrans is not specified, the default value of 5 retransmission attempts is assumed.
acregmin=n
For the mount of a Network File System, specifies the minimum number of seconds to hold locally stored file attributes after file updates. The allowed range is 1 to 3600. If acregmin is not specified, the default value of 30 seconds is assumed.
acregmax=n
For the mount of a Network File System, specifies the maximum number of seconds to hold locally stored file attributes after file updates. The allowed range is 1 to 2,000,000,000. If acregmax is not specified, the default value of 60 seconds is assumed.
acdirmin=n
For the mount of a Network File System, specifies the minimum number of seconds to hold locally stored directory attributes after a directory update. The allowed range is 1 to 3600. If acdirmin is not specified, the default value of 30 seconds is assumed.
acdirmax=n
For the mount of a Network File System, specifies the maximum number of seconds to hold locally stored directory attributes after a directory update. The allowed range is 1 to 2,000,000,000. If acdirmax is not specified the default value of 60 seconds is assumed.
nocto
For the mount of a Network File System, specifies whether to force the refresh of remote attributes when opening a file. If this option is specified, attributes are not refreshed from the server when opening a file, and changes are not sent to the server on the last close. If nocto is not specified, the default value of no suppression is assumed.
noac
For the mount of a Network File System, specifies whether to suppress local storage of attributes and names. If this option is specified, local storage of attributes and names is suppressed. If noac is not specified, the default value of no suppression is assumed. If noac is specified, values specified for agregmin, agregmax, agdirmin, and agdirmax may be specified but are not used.
async
For the mount of a Network File System, specifies whether to allow asynchronous write requests. If async is not specified, only synchronous write requests will be used.
cachetimeo=n
For the mount of a Network File System, specifies the amount of time in seconds, for the client to revalidate data cache consistency. The allowed range is 1 to 10000. If cachetimeo is not specified, the default value of 60 seconds is assumed.
nocache
For the mount of a Network File System, specifies whether to disable the data cache. If nocache is not specified, data cache will be enabled by default.
sec=flavor[:flavor...]
For the mount of a Network File System, specifies an ordered list of security flavors that may be used to access the mount point. Allowable flavor values are:
sys
UNIX-like (user ids, group ids).
krb5
Kerberos 5, no integrity or privacy. Only valid when NFS version 4 specified.
krb5i
Kerberos 5, with integrity. Only valid when NFS version 4 specified.
krb5p
Kerberos 5, with privacy. Only valid when NFS version 4 specified.
vers=version[:version...]
For the mount of a Network File System, specifies NFS versions allowed for the mount. If this option is specified, only the specified NFS versions will be used to attempt the mount, in the order they are provided. The default used if this option is not specified is vers=3:2. Allowable version numbers are: 2:3:4.

Coded character set ID (CCSID)

Specifies, for Network File Systems, a pair of coded character set identifiers (CCSIDs) to identify a specific character representation to be used. The first CCSID specifies what encoding scheme should be assumed for data files on the remote system. The second CCSID specifies what encoding scheme should be assumed for path names on the remote system.

This parameter is only valid if mounting a Network File System.

Element 1: Data file CCSID

*BINARY
No conversion is used.
*ASCII
The ASCII equivalent of the default job CCSID associated with the current job is used.
*JOBCCSID
The CCSID from the default job CCSID is used.
1-65533
Specify a CCSID to be assumed for data files on the remote system.

Element 2: Path name CCSID

*ASCII
The ASCII equivalent of the default job CCSID associated with the current job is used.
*JOBCCSID
The CCSID from the default job CCSID is used.
1-65533
Specify a CCSID to be assumed for path names on the remote system. Only CCSIDs that 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.

Code page (CODEPAGE)

Specifies, for Network File Systems, a pair of code pages. The first code page specifies what code page should be assumed for data files on the remote system. The second code page specifies what code page should be assumed for path names on the remote system.

This parameter is only valid if mounting a Network File System.

Note: This parameter is replaced by Coded character set ID (CCSID) but the CODEPAGE parameter can still be used. However, because this parameter may be removed in a later release, whenever possible use the CCSID parameter.

Element 1: Data file code page

Note: A code page that has the same number of bytes per character as the original data should be specified.

*BINARY
No conversion is used.
*ASCII
The ASCII equivalent of the default job coded character set identifier (CCSID) associated with the current job is used.
*JOBCCSID
The default job coded character set identifier (CCSID) associated with the current job is used.
1-32767
Specify a code page to be assumed for data files on the remote system. Only code pages that correspond to single-byte or double-byte encoding schemes are supported. Code pages that correspond to mixed-byte encoding schemes are not supported.

Element 2: Path name code page

*ASCII
The ASCII equivalent of the default job coded character set identifier (CCSID) associated with the current job is used.
*JOBCCSID
The default job coded character set identifier (CCSID) associated with the current job is used.
1-32767
Specify a code page to be assumed for path names on the remote system. 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.

Examples

Example 1: Mounting a User-Defined File System

ADDMFS   TYPE(*UDFS)  MFS('/DEV/QASP03/PROD1')
         MNTOVRDIR('DIRB')

This command mounts a user-defined file system PROD1 over the directory, DIRB. It uses the defaults for the other parameters.

Example 2: Mounting a Network File System

ADDMFS   TYPE(*NFS)  MFS('RAINFALL:/QSYS.LIB/RAY.LIB')
         MNTOVRDIR('/mystuff')

This command mounts the /qsys.lib/ray.lib file system from the remote system RAINFALL into the directory /mystuff.

Example 3: Mounting a Network File System with OPTIONS

ADDMFS   TYPE(*NFS)   MFS('RAINFALL:/QSYS.LIB/RAY.LIB')
         MNTOVRDIR('/mystuff')
         OPTIONS('ro,nosuid,rsize=256, retrans=10')
         CODEPAGE(*ASCII *JOBCCSID)  CCSID(*ASCII *JOBCCSID)

This command mounts the /qsys.lib/ray.lib file system from the remote system RAINFALL into the directory /mystuff. In addition it specifies to mount as read-only, not allow setuid execution, set the read buffer to 256 bytes, and the retransmission attempts to 10. The job CCSID is used to determine the coded character set identifier to use for remote path names.

Error messages

*ESCAPE Messages

CPDBCC2
A non-recoverable error occurred when attempting to resolve the name.
CPF3BCB
Encoding scheme &1 of CCSID &2 not supported.
CPFA09C
Not authorized to object. Object is &1.
CPFA09E
Object in use. Object is &1.
CPFA0A2
Information passed to this operation was not valid.
CPFA0A9
Object not found. Object is &1.
CPFA0D0
CCSID conversion error occurred.
CPFA0D9
Character string not converted.
CPFA1B0
Unrecognized option found on options list.
CPFA1B8
*IOSYSCFG authority required to use &1.
CPFA1C6
The value supplied for the File system to mount (MFS) parameter does not have the correct form.
CPFA1CE
Cannot find an address for the specified system name.