mount Options for NFS File Systems
This section describes some of the options that can follow the -o flag when you are mounting an NFS file system. For a complete list of options, refer to the
mount_nfs(8) man page.
-
bg|fg -
These options can be used to select the retry behavior if a mount fails. The
bgoption causes the mount attempts to be run in the background. Thefgoption causes the mount attempt to be run in the foreground. The default isfg, which is the best selection for file systems that must be available because it prevents further processing until the mount is complete.bgis a good selection for noncritical file systems because the client can do other processing while waiting for the mount request to be completed. -
forcedirectio -
This option improves performance of large sequential data transfers. Data is copied directly to a user buffer. No caching is performed in the kernel on the client. This option is off by default (
noforcedirectio).To permit an application to issue concurrent writes, as well as concurrent reads and writes, to a single file on the client, use the
forcedirectiomount option. This option, enables this functionality for all files within the mounted file system. You could also enable this functionality on a single file on the client by using thedirectio() interface. Unless this functionality has been enabled, writes to files are serialized. Also, if concurrent writes or concurrent reads and writes are occurring, then POSIX semantics are no longer being supported for that file.For an example of how to use this option, refer to Using the mount Command.
-
largefiles -
With this option, you can access files that are larger than 2 GB. Whether a large file can be accessed can only be controlled on the server, so this option is silently ignored on NFS Version 3 mounts. By default, all UFS file systems are mounted with
largefiles. For mounts that use the NFS Version 2 protocol, thelargefilesoption causes the mount to fail with an error. -
nolargefiles -
This option for UFS mounts guarantees that no large files can exist on the file system. Because the existence of large files can be controlled only on the NFS server, no option for
nolargefilesexists when using NFS mounts. Attempts to NFS-mount a file system by using this option are rejected with an error. -
nosuid|suid -
The
nosuidoption is the equivalent of specifying thenodevicesoption with thenosetuidoption. When thenodevicesoption is specified, the opening of device-special files on the mounted file system is disallowed. When thenosetuidoption is specified, thesetuidbit andsetgidbit in binary files that are located in the file system are ignored. The processes run with the privileges of the user who executes the binary file.The
suidoption is the equivalent of specifying thedevicesoption with thesetuidoption. When thedevicesoption is specified, the opening of device-special files on the mounted file system is allowed. When thesetuidoption is specified, thesetuidbit and thesetgidbit in binary files that are located in the file system are honored by the kernel.If neither option is specified, the default option is
suid, which provides the default behavior of specifying thedevicesoption with thesetuidoption.The following table describes the effect of combining
nosuidorsuidwithdevicesornodevices, andsetuidornosetuid. Note that in each combination of options, the most restrictive option determines the behavior.Behavior From the Combined Options Option Option Option The equivalent of
nosetuidwithnodevicesnosuidnosetuidnodevicesThe equivalent of
nosetuidwithnodevicesnosuidnosetuiddevicesThe equivalent of
nosetuidwithnodevicesnosuidsetuidnodevicesThe equivalent of
nosetuidwithnodevicesnosuidsetuiddevicesThe equivalent of
nosetuidwithnodevicessuidnosetuidnodevicesThe equivalent of
nosetuidwithdevicessuidnosetuiddevicesThe equivalent of
setuidwithnodevicessuidsetuidnodevicesThe equivalent of
setuidwithdevicessuidsetuiddevicesThe
nosuidoption provides additional security for NFS clients that access potentially untrusted servers. Mounting remote file systems with this option reduces the chance of privilege escalation through importing untrusted devices or importing untrustedsetuidbinary files. All these options are available in all Oracle Solaris file systems. -
public -
This option forces the use of the public file handle when contacting the NFS server. If the public file handle is supported by the server, the mounting operation is faster because the MOUNT protocol is not used. Also, because the MOUNT protocol is not used, the public option allows mounting to occur through a firewall.
-
rw|ro -
The
-rwand-rooptions indicate whether a file system is to be mounted read-write or read-only. The default is read-write, which is the appropriate option for remote home directories, mail-spooling directories, or other file systems that need to be changed by users. The read-only option is appropriate for directories that should not be changed by users. For example, shared copies of the man pages should not be writable by users. -
sec=mode -
You can use this option to specify the authentication mechanism to be used during the mount transaction. The available values for mode are:
-
krb5for Kerberos Version 5 authentication service -
krb5ifor Kerberos Version 5 with integrity -
krb5pfor Kerberos Version 5 with privacy -
nonefor no authentication -
dhfor Diffie-Hellman (DH) authentication -
sysfor standard UNIX authentication
The modes are also defined in
/etc/nfssec.conf. -
-
soft|hard -
An NFS file system that is mounted with the
softoption returns an error if the server does not respond. Thehardoption causes the mount to continue to retry until the server responds. The default ishard, which should be used for most file systems. Applications frequently do not check return values fromsoft-mounted file systems, which can make the application fail or can lead to corrupted files. If the application does check the return values, routing problems and other conditions can still confuse the application or lead to file corruption. In most situations, thesoftoption should not be used. If a file system is mounted by using thehardoption and becomes unavailable, an application that uses this file system hangs until the file system becomes available.