automount Command
This command installs autofs mount points and associates the information
in the automaster files with each mount point. The syntax of the command is
as follows:
automount [ -t duration ] [ -v ]
-t duration sets the time,
in seconds, that a file system is to remain mounted, and -v
selects the verbose mode. Running this command in the verbose mode allows
for easier troubleshooting.
If not specifically set, the value for duration is set to 5 minutes.
In most circumstances, this value is good. However, on systems that have many
automounted file systems, you might need to increase the duration value. In
particular, if a server has many users active, checking the automounted file
systems every 5 minutes can be inefficient. Checking the autofs file systems
every 1800 seconds, which is 30 minutes, could be more optimal. By not unmounting
the file systems every 5 minutes, /etc/mnttab can become
large. To reduce the output when df checks each entry in /etc/mnttab, you can filter the output from df
by using the -F option (see the df(1M) man page) or by using egrep.
You should consider the idea that adjusting the duration also changes
how quickly changes to the automounter maps are reflected. Changes cannot
be seen until the file system is unmounted. Refer to Modifying the Maps
for instructions on how to modify automounter maps.
clear_locks Command
This command enables you to remove all file, record, and share locks
for an NFS client. You must be root to run this command.
From an NFS server, you can clear the locks for a specific client. From an
NFS client, you can clear locks for that client on a specific server. The
following example would clear the locks for the NFS client that is named tulip on the current system.
Using the -s option enables you to specify which NFS
host to clear the locks from. You must run this option from the NFS client,
which created the locks. In this situation, the locks from the client would
be removed from the NFS server that is named bee.
Caution - This command should only be run when a client crashes and cannot
clear its locks. To avoid data corruption problems, do not clear locks for
an active client.
mount Command
With this command, you can attach a named file system, either local
or remote, to a specified mount point. For more information, see the mount(1M)
man page. Used without arguments, mount displays a list
of file systems that are currently mounted on your computer.
Many types of file systems are included in the standard Solaris installation.
Each file-system type has a specific man page that lists the options to mount that are appropriate for that file-system type. The man page
for NFS file systems is mount_nfs(1M). For UFS file systems, see mount_ufs(1M).
The Solaris 7 release includes the ability to select a path name to
mount from an NFS server by using an NFS URL instead of the standard server:/pathname syntax. See How to Mount an NFS File System Using an NFS URL for further
information.
Caution - The version of the mount command that is
included in any Solaris release from 2.6 to the current release does not warn
about invalid options. The command silently ignores any options that cannot
be interpreted. Ensure that you verify all of the options that were used so
that you can prevent unexpected behavior.
mount Options for NFS File Systems
The subsequent text lists 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(1M) man page.
- bg|fg
These options can be used
to select the retry behavior if a mount fails. The -bg option
causes the mount attempts to be run in the background. The -fg
option causes the mount attempt to be run in the foreground. The default is -fg, which is the best selection for file systems that must be available.
This option prevents further processing until the mount is complete. -bg is a good selection for non-critical file systems, because the
client can do other processing while waiting for the mount request to complete.
- forcedirectio
This option improves
performance of sequential reads on large files. Data is copied directly to
a user buffer. No caching is done in the kernel on the client. This option
is off by default.
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 Gbytes on a server that is running
the Solaris 2.6 release. 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. Starting with release 2.6, by default, all UFS file systems are
mounted with largefiles. For mounts that use
the NFS version 2 protocol, the largefiles
option 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. See the mount_ufs(1M)
man page. Because the existence of large files can only be controlled on the
NFS server, no option for nolargefiles exists
when using NFS mounts. Attempts to NFS-mount a file system by using this option
are rejected with an error.
- 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 -rw and -ro options 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 value for mode
can be one of the values that is shown in Table 15-2.
The modes are also defined in /etc/nfssec.conf.
Table 15-2 NFS Security Modes
Mode | Selected Authentication Service |
krb5 | Kerberos Version 5 |
krb5i | Kerberos Version 5 with integrity |
krb5i | Kerberos Version 5 with privacy |
none | No authentication |
dh | Diffie-Hellman (DH) authentication |
sys | Standard UNIX authentication |
- soft|hard
An NFS file system that
is mounted with the soft option returns an
error if the server does not respond. The hard
option causes the mount to continue to retry until the server responds. The
default is hard, which should be used for most
file systems. Applications frequently do not check return values from soft-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 if the soft option
is used. In most situations, the soft option
should not be used. If a file system is mounted by using the hard option and becomes unavailable, an application that uses this
file system hangs until the file system becomes available.
Using the mount Command
Refer to the following examples.
In NFS version 2 or version 3, both of these commands mount
an NFS file system from the server bee read-only:
# mount -F nfs -r bee:/export/share/man /usr/man
|
# mount -F nfs -o ro bee:/export/share/man /usr/man
|
In NFS version 2 or version 3, this command uses the -O option to force the man pages from the server bee
to be mounted on the local system even if /usr/man has
already been mounted. See the following:
# mount -F nfs -O bee:/export/share/man /usr/man
|
In NFS version 2 or version 3, this command uses client failover:
# mount -F nfs -r bee,wasp:/export/share/man /usr/man
|
Note - When used from the command line, the listed servers must support
the same version of the NFS protocol. Do not mix version 2 and version 3 servers
when running mount from the command line. You can use mixed
servers with autofs. Autofs automatically selects the best subset of version
2 or version 3 servers.
Here is an example of using an NFS URL with the mount command in NFS version 2 or version 3:
# mount -F nfs nfs://bee//export/share/man /usr/man
|
Use the mount command with no arguments
to display file systems that are mounted on a client.
% mount
/ on /dev/dsk/c0t3d0s0 read/write/setuid on Tues Jan 24 13:20:47 1995
/usr on /dev/dsk/c0t3d0s6 read/write/setuid on Tues Jan 24 13:20:47 1995
/proc on /proc read/write/setuid on Tues Jan 24 13:20:47 1995
/dev/fd on fd read/write/setuid on Tues Jan 24 13:20:47 1995
/tmp on swap read/write on Tues Jan 24 13:20:51 1995
/opt on /dev/dsk/c0t3d0s5 setuid/read/write on Tues Jan 24 13:20:51 1995
/home/kathys on bee:/export/home/bee7/kathys
intr/noquota/nosuid/remote on Tues Jan 24 13:22:13 1995
|
umount Command
This command enables you to remove a remote file system that is currently
mounted. The umount command supports the -V
option to allow for testing. You might also use the -a option
to umount several file systems at one time. If mount_points
are included with the -a option, those file systems are unmounted.
If no mount points are included, an attempt is made to unmount all file systems
that are listed in /etc/mnttab, except for the "required"
file systems, such as /, /usr, /var, /proc, /dev/fd,
and /tmp. Because the file system is already mounted
and should have an entry in /etc/mnttab, you do not need
to include a flag for the file-system type.
The -f option forces a busy file system to be unmounted.
You can use this option to unhang a client that is hung while trying to mount
an unmountable file system.
Caution - By forcing an unmount of a file system, you can cause data
loss if files are being written to.
Using the umount Command
This example unmounts a file system that is mounted on /usr/man:
This example displays the results of running umount -a -V:
# umount -a -V
umount /home/kathys
umount /opt
umount /home
umount /net
|
Notice that this command does not actually unmount the file systems.
mountall Command
Use this command to mount all file systems or a specific group of file
systems that are listed in a file-system table. The command provides a way
to do the following: Select the file-system type to be accessed with the -F FSType option
Select all the remote file systems that are listed in a file-system
table with the -r option
Select all the local file systems with the -l
option
Because all file systems that are labeled as NFS file-system
type are remote file systems, some of these options are redundant. For more
information, see the mountall(1M) man page.
|