1UMOUNT(8)                    System Administration                   UMOUNT(8)
2
3
4

NAME

6       umount - unmount file systems
7

SYNOPSIS

9       umount -a [-dflnrv] [-t fstype] [-O option...]
10
11       umount [-dflnrv] {directory|device}...
12
13       umount -h|-V
14
15

DESCRIPTION

17       The  umount command detaches the mentioned file system(s) from the file
18       hierarchy.  A file system is specified by giving the directory where it
19       has  been  mounted.  Giving the special device on which the file system
20       lives may also work, but is obsolete, mainly because it  will  fail  in
21       case this device was mounted on more than one directory.
22
23       Note  that  a  file  system cannot be unmounted when it is 'busy' - for
24       example, when there are open files on it, or when some process has  its
25       working  directory  there,  or  when  a swap file on it is in use.  The
26       offending process could even be umount itself - it opens libc, and libc
27       in  its  turn may open for example locale files.  A lazy unmount avoids
28       this problem, but it may introduce another issues. See --lazy  descrip‐
29       tion bellow.
30

OPTIONS

32       -a, --all
33              All  of the filesystems described in /proc/self/mountinfo (or in
34              deprecated /etc/mtab) are unmounted,  except  the  proc,  devfs,
35              devpts, sysfs, rpc_pipefs and nfsd filesystems. This list of the
36              filesystems may be replaced by --types umount option.
37
38       -A, --all-targets
39              Unmount all mountpoints in the current namespace for the  speci‐
40              fied  filesystem.  The filesystem can be specified by one of the
41              mountpoints or the device  name  (or  UUID,  etc.).   When  this
42              option is used together with --recursive, then all nested mounts
43              within the filesystem are recursively unmounted.  This option is
44              only  supported  on  systems  where  /etc/mtab  is  a symlink to
45              /proc/mounts.
46
47       -c, --no-canonicalize
48              Do not canonicalize paths.  The paths canonicalization is  based
49              on  stat(2) and readlink(2) system calls. These system calls may
50              hang in some cases (for example on NFS if server is  not  avail‐
51              able).  The  option  has  to  be used with canonical path to the
52              mount point.
53
54              For more details about this option see the  mount(8)  man  page.
55              Note   that   umount   does   not   pass   this  option  to  the
56              /sbin/umount.type helpers.
57
58       -d, --detach-loop
59              When the unmounted device was a loop device, also free this loop
60              device.  This  option  is unnecessary for devices initialized by
61              mount(8), in this case "autoclear" functionality is  enabled  by
62              default.
63
64       --fake Causes  everything  to be done except for the actual system call
65              or umount helper execution; this 'fakes' unmounting the filesys‐
66              tem.   It  can  be  used  to  remove entries from the deprecated
67              /etc/mtab that were unmounted earlier with the -n option.
68
69       -f, --force
70              Force an unmount (in case of an unreachable NFS system).
71
72              Note that this option does not  guarantee  that  umount  command
73              does  not hang.  It's strongly recommended to use absolute paths
74              without symlinks to avoid  unwanted  readlink  and  stat  system
75              calls on unreachable NFS in umount.
76
77       -i, --internal-only
78              Do  not  call  the  /sbin/umount.filesystem  helper  even  if it
79              exists.  By default such  a  helper  program  is  called  if  it
80              exists.
81
82       -l, --lazy
83              Lazy  unmount.   Detach  the  filesystem from the file hierarchy
84              now, and clean up all references to this filesystem as  soon  as
85              it is not busy anymore.
86
87              A system reboot would be expected in near future if you're going
88              to use this option for network filesystem  or  local  filesystem
89              with  submounts.   The  recommended use-case for umount -l is to
90              prevent hangs on shutdown due to an  unreachable  network  share
91              where a normal umount will hang due to a downed server or a net‐
92              work partition. Remounts of the share will not be possible.
93
94
95       -n, --no-mtab
96              Unmount without writing in /etc/mtab.
97
98       -O, --test-opts option...
99              Unmount only the filesystems that have the specified option  set
100              in  /etc/fstab.   More  than  one  option  may be specified in a
101              comma-separated list.  Each option can be prefixed  with  no  to
102              indicate that no action should be taken for this option.
103
104       -R, --recursive
105              Recursively  unmount  each  specified  directory.  Recursion for
106              each directory will stop if any unmount operation in  the  chain
107              fails  for  any reason.  The relationship between mountpoints is
108              determined by /proc/self/mountinfo entries.  The filesystem must
109              be  specified  by mountpoint path; a recursive unmount by device
110              name (or UUID) is unsupported.
111
112       -r, --read-only
113              When an unmount fails, try to remount the filesystem read-only.
114
115       -t, --types type...
116              Indicate that the actions should only be taken on filesystems of
117              the  specified  type.   More than one type may be specified in a
118              comma-separated list.  The list of filesystem types can be  pre‐
119              fixed with no to indicate that no action should be taken for all
120              of the mentioned types.   Note  that  umount  reads  information
121              about   mounted   filesystems  from  kernel  (/proc/mounts)  and
122              filesystem names may be different than filesystem names used  in
123              the /etc/fstab (e.g. "nfs4" vs. "nfs").
124
125       -v, --verbose
126              Verbose mode.
127
128       -V, --version
129              Display version information and exit.
130
131       -h, --help
132              Display help text and exit.
133

LOOP DEVICE

135       The  umount  command  will  automatically detach loop device previously
136       initialized by mount(8) command independently of /etc/mtab.
137
138       In this case the device is initialized with "autoclear" flag (see  los‐
139       etup(8)  output  for more details), otherwise it's necessary to use the
140       option  --detach-loop or call losetup -d <device>. The  autoclear  fea‐
141       ture is supported since Linux 2.6.25.
142

EXTERNAL HELPERS

144       The syntax of external unmount helpers is:
145
146              umount.suffix {directory|device} [-flnrv] [-t type.subtype]
147
148       where  suffix  is  the filesystem type (or the value from a uhelper= or
149       helper= marker in the mtab file).   The  -t  option  can  be  used  for
150       filesystems that have subtype support.  For example:
151
152              umount.fuse -t fuse.sshfs
153
154       A  uhelper=something  marker  (unprivileged  helper)  can appear in the
155       /etc/mtab file when ordinary users need to be able to unmount a  mount‐
156       point  that is not defined in /etc/fstab (for example for a device that
157       was mounted by udisks(1)).
158
159       A helper=type marker  in  the  mtab  file  will  redirect  all  unmount
160       requests to the /sbin/umount.type helper independently of UID.
161
162       Note  that  /etc/mtab  is  currently deprecated and helper= and another
163       userspace mount options are maintained by libmount.
164

FILES

166       /etc/mtab
167              table of mounted filesystems (deprecated and usually replaced by
168              symlink to /proc/mounts)
169
170       /etc/fstab
171              table of known filesystems
172
173       /proc/self/mountinfo
174              table of mounted filesystems generated by kernel.
175

ENVIRONMENT

177       LIBMOUNT_FSTAB=<path>
178              overrides  the  default  location of the fstab file (ignored for
179              suid)
180
181       LIBMOUNT_MTAB=<path>
182              overrides the default location of the  mtab  file  (ignored  for
183              suid)
184
185       LIBMOUNT_DEBUG=all
186              enables libmount debug output
187

SEE ALSO

189       umount(2), losetup(8), mount(8)
190

HISTORY

192       A umount command appeared in Version 6 AT&T UNIX.
193

AVAILABILITY

195       The  umount  command is part of the util-linux package and is available
196       from Linux Kernel Archive ⟨https://www.kernel.org/pub/linux/utils/util-
197       linux/⟩.
198
199
200
201util-linux                         July 2014                         UMOUNT(8)
Impressum