xref: /freebsd/sbin/umount/umount.8 (revision 6e1fc0118033f42b7c0d3623c8f67a89ebecabb2)
18fae3551SRodney W. Grimes.\" Copyright (c) 1980, 1989, 1991, 1993
28fae3551SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
38fae3551SRodney W. Grimes.\"
48fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
58fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions
68fae3551SRodney W. Grimes.\" are met:
78fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
88fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
98fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
108fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
118fae3551SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
138fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
148fae3551SRodney W. Grimes.\"    without specific prior written permission.
158fae3551SRodney W. Grimes.\"
168fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
178fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
188fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
198fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
208fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
218fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
228fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
238fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
248fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
258fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
268fae3551SRodney W. Grimes.\" SUCH DAMAGE.
278fae3551SRodney W. Grimes.\"
28840a8027SRicardo Branco.Dd January 16, 2024
298fae3551SRodney W. Grimes.Dt UMOUNT 8
309fe48c6eSRuslan Ermilov.Os
318fae3551SRodney W. Grimes.Sh NAME
328fae3551SRodney W. Grimes.Nm umount
338fae3551SRodney W. Grimes.Nd unmount file systems
348fae3551SRodney W. Grimes.Sh SYNOPSIS
357c7fb079SRuslan Ermilov.Nm
36840a8027SRicardo Branco.Op Fl dfNnv
3734ae1bb6SRuslan Ermilov.Ar special ... | node ... | fsid ...
387c7fb079SRuslan Ermilov.Nm
39d499a0efSBruce Evans.Fl a | A
40ef258dd9SMatthew N. Dodd.Op Fl F Ar fstab
41debc480eSEdward Tomasz Napierala.Op Fl fnv
428fae3551SRodney W. Grimes.Op Fl h Ar host
43d499a0efSBruce Evans.Op Fl t Ar type
448fae3551SRodney W. Grimes.Sh DESCRIPTION
458fae3551SRodney W. GrimesThe
46cbc0b9d0SSteve Price.Nm
47629e80efSPhilippe Charnierutility calls the
488fae3551SRodney W. Grimes.Xr unmount 2
4938f102c2SIan Dowsesystem call to remove a file system from the file system tree.
5038f102c2SIan DowseThe file system can be specified by its
518fae3551SRodney W. Grimes.Ar special
52789e4d2fSMateusz Piotrowskidevice or remote node
53789e4d2fSMateusz Piotrowski.Pq Ar rhost Ns Cm \& : Ns Ar path ,
54789e4d2fSMateusz Piotrowskithe path to the mount point
558fae3551SRodney W. Grimes.Ar node
5638f102c2SIan Dowseor by the file system ID
5738f102c2SIan Dowse.Ar fsid
5838f102c2SIan Dowseas reported by
5948423f5dSPawel Jakub Dawidek.Dq mount -v
6048423f5dSPawel Jakub Dawidekwhen run by root.
618fae3551SRodney W. Grimes.Pp
628fae3551SRodney W. GrimesThe options are as follows:
63789e4d2fSMateusz Piotrowski.Bl -tag -width "-F fstab"
648fae3551SRodney W. Grimes.It Fl a
65d499a0efSBruce EvansAll the file systems described in
668fae3551SRodney W. Grimes.Xr fstab 5
678fae3551SRodney W. Grimesare unmounted.
68d499a0efSBruce Evans.It Fl A
690a0c1818SMateusz PiotrowskiAll the currently mounted file systems are unmounted,
700a0c1818SMateusz Piotrowskiexcept for those mounted at
710a0c1818SMateusz Piotrowski.Pa /
720a0c1818SMateusz Piotrowskior
730a0c1818SMateusz Piotrowski.Pa /dev .
74840a8027SRicardo Branco.It Fl d
75840a8027SRicardo BrancoIf the filesystem is mounted on an
76840a8027SRicardo Branco.Xr md 4
77840a8027SRicardo Brancodevice (a memory disk), detach it after
78840a8027SRicardo Branco.Xr unmount 2 .
79ef258dd9SMatthew N. Dodd.It Fl F Ar fstab
80ef258dd9SMatthew N. DoddSpecify the
81ef258dd9SMatthew N. Dodd.Pa fstab
82ef258dd9SMatthew N. Doddfile to use.
838fae3551SRodney W. Grimes.It Fl f
848fae3551SRodney W. GrimesThe file system is forcibly unmounted.
858fae3551SRodney W. GrimesActive special devices continue to work,
868fae3551SRodney W. Grimesbut all other files return errors if further accesses are attempted.
878fae3551SRodney W. GrimesThe root file system cannot be forcibly unmounted.
886b43e31fSRick MacklemFor NFS, a forced dismount can take up to 1 minute or more to
896b43e31fSRick Macklemcomplete against an unresponsive server and may throw away
906b43e31fSRick Macklemdata not yet written to the server for this case.
914261923eSRick MacklemIf a process, such as
924261923eSRick Macklem.Nm
934261923eSRick Macklemwithout the
944261923eSRick Macklem.Fl f
954261923eSRick Macklemflag is hung on an
964261923eSRick Macklem.Tn NFS
974261923eSRick Macklemmount point, use the
984261923eSRick Macklem.Fl N
994261923eSRick Macklemflag instead.
1001e68ee21SRick MacklemAlso, doing a forced dismount of an NFSv3 mount when
1011e68ee21SRick Macklem.Xr rpc.lockd 8
1021e68ee21SRick Macklemis running is unsafe and can result in a crash.
1038fae3551SRodney W. Grimes.It Fl h Ar host
1048fae3551SRodney W. GrimesOnly file systems mounted from the specified host will be
1058fae3551SRodney W. Grimesunmounted.
106cbc0b9d0SSteve PriceThis option implies the
107d499a0efSBruce Evans.Fl A
1088fae3551SRodney W. Grimesoption and, unless otherwise specified with the
1098fae3551SRodney W. Grimes.Fl t
110adb378ceSPhilippe Charnieroption, will only unmount
111adb378ceSPhilippe Charnier.Tn NFS
112adb378ceSPhilippe Charnierfile systems.
1134261923eSRick Macklem.It Fl N
1144261923eSRick MacklemDo a forced dismount of an
1154261923eSRick Macklem.Tn NFS
1164261923eSRick Macklemmount point without checking the mount path.
1174261923eSRick MacklemThis option can only be used with the path to the mount point
1184261923eSRick Macklem.Ar node
1194261923eSRick Macklemand the path must be specified exactly as it was at mount time.
1204261923eSRick MacklemThis option is useful when a process is hung waiting for an unresponsive
1214261923eSRick Macklem.Tn NFS
1224261923eSRick Macklemserver while holding a vnode lock on the mounted-on vnode, such that
1234261923eSRick Macklem.Nm
1244261923eSRick Macklemwith the
1254261923eSRick Macklem.Fl f
1264261923eSRick Macklemflag can't complete.
1274261923eSRick MacklemUsing this option can result in a loss of file updates that have not been
1284261923eSRick Macklemflushed to the
1294261923eSRick Macklem.Tn NFS
1304261923eSRick Macklemserver.
131debc480eSEdward Tomasz Napierala.It Fl n
132debc480eSEdward Tomasz NapieralaUnless the
133debc480eSEdward Tomasz Napierala.Fl f
134debc480eSEdward Tomasz Napieralais used, the
135debc480eSEdward Tomasz Napierala.Nm
136debc480eSEdward Tomasz Napieralawill not unmount an active file system.
137debc480eSEdward Tomasz NapieralaIt will, however, perform a flush.
138debc480eSEdward Tomasz NapieralaThis flag disables this behaviour, preventing the flush
139debc480eSEdward Tomasz Napieralaif there are any files open.
140d499a0efSBruce Evans.It Fl t Ar type
1418fae3551SRodney W. GrimesIs used to indicate the actions should only be taken on
1428fae3551SRodney W. Grimesfile systems of the specified type.
1438fae3551SRodney W. GrimesMore than one type may be specified in a comma separated list.
1448fae3551SRodney W. GrimesThe list of file system types can be prefixed with
1458fae3551SRodney W. Grimes.Dq no
1468fae3551SRodney W. Grimesto specify the file system types for which action should
1478fae3551SRodney W. Grimes.Em not
1488fae3551SRodney W. Grimesbe taken.
1498fae3551SRodney W. GrimesFor example, the
150cbc0b9d0SSteve Price.Nm
1518fae3551SRodney W. Grimescommand:
1528fae3551SRodney W. Grimes.Bd -literal -offset indent
1530b381bf1SRuslan Ermilovumount -a -t nfs,nullfs
1548fae3551SRodney W. Grimes.Ed
1558fae3551SRodney W. Grimes.Pp
156ceb453beSDavid Maloneunmounts all file systems of the type
1578fae3551SRodney W. Grimes.Tn NFS
1588fae3551SRodney W. Grimesand
1590b381bf1SRuslan Ermilov.Tn NULLFS
160ceb453beSDavid Malonethat are listed in the
161ceb453beSDavid Malone.Xr fstab 5
162ceb453beSDavid Malonefile.
1638fae3551SRodney W. Grimes.It Fl v
1648fae3551SRodney W. GrimesVerbose, additional information is printed out as each file system
1658fae3551SRodney W. Grimesis unmounted.
1668fae3551SRodney W. Grimes.El
167ef258dd9SMatthew N. Dodd.Sh ENVIRONMENT
168865df8ffSRuslan Ermilov.Bl -tag -width ".Ev PATH_FSTAB"
169865df8ffSRuslan Ermilov.It Ev PATH_FSTAB
170ef258dd9SMatthew N. DoddIf the environment variable
171865df8ffSRuslan Ermilov.Ev PATH_FSTAB
172865df8ffSRuslan Ermilovis set, all operations are performed against the specified file.
173865df8ffSRuslan Ermilov.Ev PATH_FSTAB
174564b641eSMatthew N. Doddwill not be honored if the process environment or memory address space is
1750e9efd19SChristian Bruefferconsidered
176564b641eSMatthew N. Dodd.Dq tainted .
177564b641eSMatthew N. Dodd(See
178865df8ffSRuslan Ermilov.Xr issetugid 2
179564b641eSMatthew N. Doddfor more information.)
180ef258dd9SMatthew N. Dodd.El
1818fae3551SRodney W. Grimes.Sh FILES
1828fae3551SRodney W. Grimes.Bl -tag -width /etc/fstab -compact
1838fae3551SRodney W. Grimes.It Pa /etc/fstab
1848fae3551SRodney W. Grimesfile system table
1858fae3551SRodney W. Grimes.El
1868fae3551SRodney W. Grimes.Sh SEE ALSO
1878fae3551SRodney W. Grimes.Xr unmount 2 ,
1888fae3551SRodney W. Grimes.Xr fstab 5 ,
189a0252a0aSEdward Tomasz Napierala.Xr autounmountd 8 ,
190*6e1fc011SGraham Percival.Xr mdconfig 8 ,
191*6e1fc011SGraham Percival.Xr mount 8
1928fae3551SRodney W. Grimes.Sh HISTORY
1938fae3551SRodney W. GrimesA
194cbc0b9d0SSteve Price.Nm
195629e80efSPhilippe Charnierutility appeared in
196f1a6b7cbSAllan Jude.At v1 .
197