mknfsmnt Command

Purpose

Mounts a directory from an NFS server.

Syntax

/usr/sbin/mknfsmnt -f PathName -d RemoteDirectory -h RemoteHost [ -t { rw | ro } ] [ -m MountTypeName ] [ -w { fg | bg } ] [ -X | -x ] [ -S | -H ] [ -Y | -y ] [ -Z | -z ] [ -e | -E ] [ -a | -A ] [ -j | [ -J ] [ -q | [ -Q ] [ -g | [ -G ] [ -s | -n ] [ -I | -B | -N ] [ -r TimesToRetry ] [ -R NumRetrans ] [ -b ReadBufferSize ] [ -c WriteBufferSize ] [ -o TimeOut ] [ -P PortNumber ] [ -u AcRegMin ] [ -U AcRegMax ] [ -v AcDirMin ] [ -V AcDirMax ] [ -T AcTimeOut ] [ -p NumBiods ] [ -K { any | 2 | 3 | 4 } ] [ -k { any | tcp | udp } ] [ -l | -L ] [-M security_methods] [ -i { dio | cio [,cior ] } ]

Description

The mknfsmnt command constructs an entry that is appended to the /etc/filesystems file, thus making a file system available for mounting. If the mount is to be permanent, this entry remains. If the mount is temporary, the flags are used directly for the mount command. If the mount is soft and the server does not respond, the system returns an error. If the mount is hard, the client continues trying until the server responds. The hard mount is the default mount.

Flags

Item Description
-A The /etc/filesystems entry for this file system specifies that it should be automatically mounted at system restart.
-a The /etc/filesystems entry for this file system specifies that it should not be automatically mounted at system restart. This is the default flag.
-B Adds an entry to the /etc/filesystems file and attempts to mount the file system. This is the default flag.
-b ReadBufferSize Indicates the size of the read buffer in bytes specified by the ReadBufferSize variable.
-c WriteBufferSize Indicates the size of the write buffer in bytes specified by the WriteBufferSize variable.
-d RemoteDirectory Specifies the directory that is mounted on the path name specified.
-E Allows keyboard interrupts on hard mounts.
-e Prevents keyboard interrupts on hard mounts. This is the default flag.
-f PathName Specifies the mount point for the remote directory.
-G Directs any file or directory created on the file system to inherit the group ID of the parent directory.
-g Does not direct new files or directories created on the file system to inherit the group ID of the parent directory. This is the default flag.
-H Creates a hard mount, which causes the client to continue retrying until the server responds. This is the default flag.
-h RemoteHost Specifies the NFS server that is exporting the directory.
-I Causes an entry to be added to the /etc/filesystems file. The directory is not mounted.
-i Specifies I/O mode for the mount. The options are:
cio
Specifies concurrent I/O mode. Specifies the file system to be mounted for concurrent readers and writers. I/O on files in this file system will behave as if they had been opened with O_CIO specified in the open() system call.
dio
Specifies direct I/O mode. Specifies that I/O on the file system will behave as if all the files had been opened with O_DIRECT specified in the open() system call.
cior
Specifies concurrent I/O with read-only mode.
Note: For more information on the cio and dio options, see the mount command.
-J Indicates that acls are used on this mount.
-j Indicates that acls are not used on this mount. This is the default flag.
-K Specifies the NFS version used for this NFS mount. The options are:
any
Uses the mount command to determine the correct match. Refer to the mount command for a description of the current default behavior.
2
Specifies NFS Version 2.
3
Specifies NFS Version 3.
4
Specifies NFS Version 4.
-k Specifies the transport protocol used for the mount. The options are:
any
Uses the mount command to select the protocol to use. TCP protocol is the preferred protocol.
tcp
Specifies the TCP protocol.
udp
Specifies the UDP protocol.
L Indicates that the lock requests are handled locally without connecting to the server.
l Indicates that the lock requests are not handled locally. The server handles the lock requests.
-M security_methods A list of security methods to use when attempting the mount. A comma separated list of the values sys, dh, krb5, krb5i, krb5p, which correspond to UNIX, DES, Kerberos 5, Kerberos 5 with integrity, and Kerberos 5 with privacy. Multiple values are allowed, but are meaningful only with NFS Version 4 mounts. If multiple methods are given for a Version 2 or 3 protocol mount, the first method is used. For a NFS Version 4 mount, the methods are tried in the listed order.
-m MountTypeName Specifies the type of file system to mount. File system types are specified in the /etc/filesystems file with the type variables. When the mount -t MountTypeName command is issued, all the currently unmounted file systems with a type equal to the MountTypeName are mounted.
-N Mounts the directory with the options specified but does not modify the /etc/filesystems file.
-n Instructs the mount not to use a more secure protocol. This is the default flag.
-o TimeOut Indicates the length of the NFS timeout in tenths of a second as specified by the TimeOut variable.
-P PortNumber Indicates the Internet Protocol port number for the server.
-p NumBiods Specifies the number of biod daemons that are allowed to work on a particular file system. The biod daemons handle client requests. The default number of daemons is 7 for NFS Version 2 and 32 for NFS Version 3 and NFS Version 4.
-Q Requests that no posix pathconf information be exchanged and made available on an NFS Version 2 mount. Requires a mount Version 2 rpc.mountd at the NFS server.
-q Specifies that no posix pathconf information is exchanged if mounted as an NFS Version 2 mount. This is the default flag.
-r TimesToRetry Indicates the number of times to retry a mount. The default value is 1000.
-R NumRetrans For a soft mount, this flag specifies the number of times that a request has to be transmitted if it is not acknowledged by the server. If the request is unacknowledged after NumRetrans transmissions, the client gives up the request. If this flag is not specified, the default value 3 is used.
-S Creates a soft mount, which means the system returns an error if the server does not respond.
-s Instructs the mount to use a more secure protocol.
-T AcTimeOut Sets the minimum and maximum times allowed for regular files and directories to the number of seconds specified by the Actimeo variable. If this flag is specified, the other cached attribute times are overridden.
-t Type Specifies that the directory is either read-write or read-only.
rw
Mounts the directory read-write. This type is the default for the system.
ro
Mounts the directory read-only.
-U AcRegMax Holds cached attributes for no more than the number of seconds specified by the AcRegMax variable after file modification.
-u AcRegMin Holds cached attributes for at least the number of seconds specified by the AcRegMin variable after file modification.
-V AcDirMax Holds cached attributes for no more than the number of seconds specified by the AcDirMax variable after directory update.
-v AcDirMin Holds cached attributes for at least the number of seconds specified by the AcDirMin variable after directory update.
-w Location Indicates where the mount should be attempted. The Location variable can have one of the following values:
fg
Attempts the mount in the foreground. This is the default value.
bg
Attempts the mount in the background. If background is specified and the attempt to mount the directory fails, the mount will be retried in the background.
-x Specifies that the server does not support long device numbers.

Use this flag when mounting from an NFS server that does not correctly handle device numbers that are 32 bits long.

-X Specifies that the server does support long device numbers. This is the default flag.
-y Indicates that the execution of suid and sgid programs is not allowed in this file system.
-Y Indicates that the execution of suid and sgid programs are allowed in this file system. This is the default flag.
-z Indicates that device access through this mount is not allowed; that is, the device cannot be opened on this mount point.
-Z Indicates that device access through this mount is allowed. This is the default flag.

Example

To add the mount of a remote directory, enter:

mknfsmnt -f /usr/share/man -d /usr/share/man -h host1

In this example, the mknfsmnt command mounts the remote directory /usr/share/man on the /usr/share/man directory that resides on host1.

Files

Item Description
/etc/filesystems Lists the remote file systems to be mounted during the system restart.

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in AIX® Version 7.1 Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.