umount or unmount Command

Purpose

Unmounts a previously mounted file system, directory, or file.

Syntax

unmount | umount } [  -f ] [  -a ] | [  all allr Device Directory File FileSystem -n Node | -t Type ]

Description

Another name for the umount command is the unmount command. Either name can be used. You can use the System Management Interface Tool (SMIT) to run this command. To use SMIT, enter:

smit umount

The umount command unmounts a previously mounted device, directory, file, or file system. Processing on the file system, directory, or file completes and it is unmounted. Members of the system group and users operating with root user authority can issue any umount command. Only users with root authority or are members of the system group can unmount a directory or file.

Note: SMIT will not unmount the /usr/lpp/info/$LANG directory, the directory on which SMIT helps are located. Typically, this is the CD-ROM.

To unmount local mounts you can specify the device, directory, file, or file system on which it is mounted.

If the file system being unmounted is a JFS2 snapshot, the umount command will unmount the snapshot, though the snapshot will still be active. The snapshot command must be used to delete the snapshot.

If the file system being unmounted is a snapped file system with mounted snapshots, the umount command displays a warning that there are mounted snapshots and exits without unmounting the file system. The snapshots must be unmounted first.

Note: If the cdromd CD and DVD automount daemon is enabled, then those devices will be automatically mounted as specified in the /etc/cdromd.conf file. Use the cdumount or cdeject command to unmount an automounted CD or DVD. Use "stopsrc -s cdromd" to disable the CD/DVD automount daemon.

Flags

Item Description
-a Unmounts all mounted file systems.
all Unmounts all mounted file systems.
allr Unmounts all remotely mounted file systems.
Note: For remote mounts, specify the device, directory, file, or file system parameters. If you specify the allr flag, the umount command unmounts all remote mounts.
-f For remote mounted file systems, the –f flag forces an unmount to free a client when the server is down and server path names cannot be resolved, or when a file system must be unmounted while it is still in use.
Note: For remote file systems, using this flag causes all file operations on the file system except close() and unmap() to fail. Any file data that has been written by an application but has not yet transferred to the server will be lost. A forced unmount of an NFS version 4 file system can cause open file state for other file systems mounted from the same server to be lost as well.
For local JFS2 file systems, the –f flag forces an unmount when a file system must be unmounted while it is still in use.
Note: You can use the -f flag only in JFS2 file systems, not in other journaled file systems. The following restrictions are applied on a forced unmount of a JFS2 file system:
  • The –f flag cannot force an unmount of a file system if a subdirectory or a file is overmounted on the file system.
  • The–f flag cannot force an unmount of a file system with mounted or open external snapshots until those snapshots are forced unmounted.
-n Node Specifies the node holding the mounted directory you want to unmount. The umount -n Node command unmounts all remote mounts made from the Node parameter.
-t Type Unmounts all stanzas in the /etc/filesystems file that contain the type=Type flag and are mounted. The Type parameter is a string value, such as the remote value that specifies the name of the group.
Note: You cannot use the umount command on a device in use. A device is in use if any file is open for any reason or if a user's current directory is on that device.

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.

Examples

  1. To unmount all mounts from remote node Node A, enter:

    umount  -n nodeA

  2. To unmount files and directories of a specific type, enter:

    umount  -t test

    This unmounts all files or directories that have a stanza in the /etc/filesystems file that contains the type=test attribute.

Files

Item Description
/etc/filesystems Lists the known file systems and defines their characteristics.