Name

umount

Synopsis

    umount [options] [directory | special-device]

System administration command. Unmount a filesystem. umount announces to the system that the removable file structure previously mounted on the specified directory is to be removed. umount also accepts the special-device to indicate the filesystem to be unmounted; however, this usage is obsolete and will fail if the device is mounted on more than one directory. Any pending I/O for the filesystem is completed, and the file structure is flagged as clean. A busy filesystem (one with open files or with a directory that is some process’s current directory) cannot be unmounted.

Options

-a

Unmount all filesystems that are listed in /etc/mtab.

-d

If the unmounted device was a loop device, free the loop device too. See also losetup(8).

-f

Force the unmount.

-h

Print help message and exit.

-l

Lazy unmount. Detach the filesystem from the hierarchy immediately, but don’t clean up references until it is no longer busy. Requires kernel 2.4.11 or later.

-n

Unmount, but do not record changes in /etc/mtab.

-O options

Unmount only filesystems with the specified options in /etc/fstab. Specify multiple options as a comma-separated list. Add no as a prefix to an option to indicate filesystems that should not be unmounted.

-r

If unmounting fails, try to remount read-only.

-t type

Unmount only filesystems of type type. Multiple types can be specified as a comma-separated list, and any type can be prefixed with no to specify that filesystems ...

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.