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

NAME

6       umount - unmount file systems
7

SYNOPSIS

9       umount [-hV]
10
11       umount -a [-dflnrv] [-t vfstype] [-O options]
12       umount [-dflnrv] {dir|device}...
13

DESCRIPTION

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

OPTIONS

30       -a, --all
31              All  of  the  file systems described in /etc/mtab are unmounted.
32              (With umount version 2.7 and later: the proc filesystem  is  not
33              unmounted.)
34
35       -A, --all-targets
36              Unmount  all mountpoints in the current namespace for the speci‐
37              fied filesystem.  The filesystem could be specified  by  one  of
38              the  mountpoints  or  device  name  (or UUID, etc.). This option
39              could be used together with --recursive then all  nested  mounts
40              within the filesystem are recursively unmounted.
41
42       -c, --no-canonicalize
43              Do  not  canonicalize paths.  For more details about this option
44              see the mount(8) man page.
45
46       -d, --detach-loop
47              When the unmounted device was a loop device, also free this loop
48              device.  This  option  is unnecessary for devices initialized by
49              mount(8), in this case "autoclear" functionality is  enabled  by
50              default.
51
52       --fake Causes  everything to be done except for the actual system call;
53              this 'fakes' unmounting the  filesystem.   It  can  be  used  to
54              remove  entries  from /etc/mtab that were unmounted earlier with
55              the -n option.
56
57       -f, --force
58              Force unmount (in case of an unreachable NFS system).  (Requires
59              kernel 2.1.116 or later.)
60
61       -i, --internal-only
62              Do  not  call  the  /sbin/umount.<filesystem>  helper even if it
63              exists.  By default /sbin/umount.<filesystem> helper  is  called
64              if one exists.
65
66       -n, --no-mtab
67              Unmount without writing in /etc/mtab.
68
69       -l, --lazy
70              Lazy unmount.  Detach the filesystem from the filesystem hierar‐
71              chy now, and cleanup all references to the filesystem as soon as
72              it is not busy anymore.  (Requires kernel 2.4.11 or later.)
73
74              A system reboot would be expected in near future if you're going
75              to use this option for network filesystem  or  local  filesystem
76              with  submounts.   The  recommended use-case for umount -l is to
77              prevent hangs on shutdown due to an  unreachable  network  share
78              where a normal umount will hang due to a downed server or a net‐
79              work partition. Remounts of the share will not be possible.
80
81
82       -O, --test-opts options,list
83              Indicate that the actions should only be taken on  file  systems
84              with  the specified options in /etc/fstab.  More than one option
85              type may be specified in a comma separated  list.   Each  option
86              can  be  prefixed with no to specify options for which no action
87              should be taken.
88
89       -R, --recursive
90              Recursively unmount each directory specified. Recursion for each
91              directory  will stop if any unmount operation in the chain fails
92              for any reason. The relationship between mountpoints  is  deter‐
93              mined  by  /proc/self/mountinfo  entries. The filesystem must be
94              specified by mountpoint path, recursive unmount by  device  name
95              (or UUID) is unsupported.
96
97       -r, --read-only
98              In case unmounting fails, try to remount read-only.
99
100       -t, --types vfstype,ext2,ext3
101              Indicate  that  the actions should only be taken on file systems
102              of the specified type.  More than one type may be specified in a
103              comma separated list.  The list of file system types can be pre‐
104              fixed with no to specify the  file  system  types  on  which  no
105              action should be taken.
106
107       -v, --verbose
108              Verbose mode.
109
110       -h, --help
111              Print help message and exit.
112
113       -V, --version
114              Print version and exit.
115

THE LOOP DEVICE

117       The  umount  command  will  automatically detach loop device previously
118       initialized by mount(8) command independently of /etc/mtab.
119
120       In this case the device is initialized with "autoclear" flag (see  los‐
121       etup(8)  output  for more details), otherwise it's necessary to use the
122       option  --detach-loop or call losetup -d <device>. The  autoclear  fea‐
123       ture is supported since Linux 2.6.25.
124

NOTES

126       The syntax of external umount helpers is:
127
128       /sbin/umount.<suffix> {dir|device} [-nlfvr] [-t type.subtype]
129
130       where  the  <suffix>  is  filesystem type or a value from "uhelper=" or
131       "helper=" mtab option.  The -t option is used for filesystems with sub‐
132       types support (for example /sbin/mount.fuse -t fuse.sshfs).
133
134       The  uhelper= (unprivileged umount helper) is possible to use when non-
135       root user wants to umount a mountpoint which  is  not  defined  in  the
136       /etc/fstab file (e.g. devices mounted by udisk).
137
138       The   helper=  mount  option  redirects  all  umount  requests  to  the
139       /sbin/umount.<helper> independently on UID.
140

FILES

142       /etc/mtab table of mounted file systems
143

ENVIRONMENT

145       LIBMOUNT_FSTAB=<path>
146              overrides the default location of the fstab file
147
148       LIBMOUNT_MTAB=<path>
149              overrides the default location of the mtab file
150
151       LIBMOUNT_DEBUG=0xffff
152              enables debug output
153

SEE ALSO

155       umount(2), mount(8), losetup(8)
156

HISTORY

158       A umount command appeared in Version 6 AT&T UNIX.
159

AVAILABILITY

161       The umount command is part of the util-linux package and  is  available
162       from  Linux  Kernel Archive ⟨ftp://ftp.kernel.org/pub/linux/utils/util-
163       linux/⟩.
164
165
166
167util-linux                        August 2012                        UMOUNT(8)
Impressum