]> git.ipfire.org Git - thirdparty/util-linux.git/blame - misc-utils/findmnt.8
docs: don't use bold or italics for "[option]" in synopsis of man pages
[thirdparty/util-linux.git] / misc-utils / findmnt.8
CommitLineData
62b4550f 1.\" -*- nroff -*-
9421a1a3 2.TH FINDMNT 8 "June 2014" "util-linux" "System Administration"
62b4550f
KZ
3.SH NAME
4findmnt \- find a filesystem
5.SH SYNOPSIS
6.B findmnt
f49ccec2 7[options]
62b4550f
KZ
8.sp
9.B findmnt
f49ccec2 10[options]
62b4550f
KZ
11.IR device | mountpoint
12.sp
13.B findmnt
f49ccec2
BS
14[options]
15.RB [ \-\-source ]
62b4550f 16.IR device
f49ccec2 17.RB [ \-\-target ]
62b4550f
KZ
18.IR mountpoint
19.SH DESCRIPTION
20.B findmnt
d0bb6987 21will list all mounted filesytems or search for a filesystem. The
62b4550f 22.B findmnt
d0bb6987 23command is able to search in
62b4550f
KZ
24.IR /etc/fstab ,
25.IR /etc/mtab
26or
27.IR /proc/self/mountinfo .
28If
29.IR device
30or
31.IR mountpoint
d0bb6987 32is not given, all filesystems are shown.
62b4550f 33.PP
469202cd
BS
34The device may be specified by device name, maj:min, filesystem LABEL or UUID,
35or partition PARTUUID or PARTLABEL. Note that a device name may be interpreted
36as a mountpoint (and vice versa) if the \fB--target\fR or \fB--source\fR options
37are not specified.
cd492186 38.PP
d0bb6987 39The command prints all mounted filesystems in the tree-like format by default.
62b4550f 40.SH OPTIONS
4b44c245
BS
41.TP
42.BR \-A , " \-\-all"
cd4ed46f 43Disable all built-in filters and print all filesystems.
4b44c245
BS
44.TP
45.BR \-a , " \-\-ascii"
cd4ed46f 46Use ascii characters for tree formatting.
4b44c245 47.TP
2b6759df
KZ
48.BR \-b , " \-\-bytes"
49Print the SIZE, USED and AVAIL column in bytes rather than in a human-readable format.
50.TP
097e7f2f 51.BR \-C , " \-\-nocanonicalize"
9421a1a3
BS
52Do not canonicalize paths at all. This option affects the comparing of paths
53and the evaluation of tags (LABEL, UUID, etc.).
097e7f2f 54.TP
4b44c245 55.BR \-c , " \-\-canonicalize"
62b4550f 56Canonicalize all printed paths.
4b44c245
BS
57.TP
58.BR \-D , " \-\-df"
469202cd
BS
59Imitate the output of
60.BR df (1).
61This option is equivalent to
62.B -o SOURCE,FSTYPE,SIZE,USED,AVAIL,USE%,TARGET
63but excludes all pseudo filesystems.
64Use \fB\-\-all\fP to print all filesystems.
4b44c245
BS
65.TP
66.BR \-d , " \-\-direction \fIword\fP"
469202cd 67The search direction, either
9421a1a3 68.B forward
62b4550f 69or
9421a1a3 70.BR backward .
4b44c245
BS
71.TP
72.BR \-e , " \-\-evaluate"
090b5e84 73Convert all tags (LABEL, UUID, PARTUUID or PARTLABEL) to the device names.
4b44c245
BS
74.TP
75.BR \-F , " \-\-tab\-file \fIpath\fP"
469202cd
BS
76Search in an alternative file. If used with \fB\-\-fstab\fP, \fB\-\-mtab\fP
77or \fB\-\-kernel\fP, then it overrides the default paths. If specified more
78than once, then tree-like output is disabled (see the \fB\-\-list\fP option).
4b44c245
BS
79.TP
80.BR \-f , " \-\-first\-only"
62b4550f 81Print the first matching filesystem only.
4b44c245
BS
82.TP
83.BR \-h , " \-\-help"
b4362b6f 84Display help text and exit.
4b44c245
BS
85.TP
86.BR \-i , " \-\-invert"
d0bb6987 87Invert the sense of matching.
4b44c245
BS
88.TP
89.BR \-k , " \-\-kernel"
469202cd
BS
90Search in
91.IR /proc/self/mountinfo .
92The output is in the tree-like format. This is the default.
4b44c245
BS
93.TP
94.BR \-l , " \-\-list"
469202cd
BS
95Use the list output format. This output format is automatically enabled if the
96output is restricted by the \fB\-t\fP, \fB\-O\fP, \fB\-S\fP or \fB\-T\fP
aca72ac2
KZ
97option and the option \fB\-\-submounts\fP is not used or if more that one
98source file (the option \fB\-F\fP) is specified.
4b44c245
BS
99.TP
100.BR \-m , " \-\-mtab"
469202cd
BS
101Search in
102.IR /etc/mtab .
103The output is in the list format (see \fB\-\-list\fP).
4b44c245
BS
104.TP
105.BR \-N , " \-\-task \fItid\fP"
c7fcc830 106Use alternative namespace /proc/<tid>/mountinfo rather than the default
469202cd
BS
107/proc/self/mountinfo. If the option is specified more than once, then
108tree-like output is disabled (see the \fB\-\-list\fP option). See also the
c7fcc830
KZ
109.BR unshare (1)
110command.
4b44c245
BS
111.TP
112.BR \-n , " \-\-noheadings"
d0bb6987 113Do not print a header line.
4b44c245
BS
114.TP
115.BR \-O , " \-\-options \fIlist\fP"
de9501ab 116Limit the set of printed filesystems. More than one option
d0bb6987 117may be specified in a comma-separated list. The
62b4550f
KZ
118.B \-t
119and
120.B \-O
d0bb6987 121options are cumulative in effect. It is different from
62b4550f
KZ
122.B \-t
123in that each option is matched exactly; a leading
124.I no
469202cd
BS
125at the beginning does not have global meaning. The "no" can used for
126individual items in the list. The "no" prefix interpretation can be disabled
ede8a60e 127by "+" prefix.
4b44c245
BS
128.TP
129.BR \-o , " \-\-output \fIlist\fP"
469202cd
BS
130Define output columns. See the \fB\-\-help\fP output to get a list of the
131currently supported columns. The
62b4550f
KZ
132.BR TARGET
133column contains tree formatting if the
134.B \-\-list
135or
136.B \-\-raw
137options are not specified.
36fb1007 138
37684203
BS
139The default list of columns may be extended if \fIlist\fP is
140specified in the format \fI+list\fP (e.g. \fBfindmnt -o +PROPAGATION\fP).
4b44c245
BS
141.TP
142.BR \-P , " \-\-pairs"
469202cd 143Use key="value" output format. All potentially unsafe characters are hex-escaped (\\x<code>).
4b44c245
BS
144.TP
145.BR \-p , " \-\-poll\fR[\fI=list\fR]"
469202cd
BS
146Monitor changes in the /proc/self/mountinfo file. Supported actions are: mount,
147umount, remount and move. More than one action may be specified in a
148comma-separated list. All actions are monitored by default.
582a5006 149
de9501ab 150The time for which \fB--poll\fR will block can be restricted with the \fB\-\-timeout\fP
582a5006
KZ
151or \fB\-\-first-only\fP options.
152
153The standard columns always use the new version of the information from the
154mountinfo file, except the umount action which is based on the original
155information cached by
a8862fab
KZ
156.BR findmnt (8) .
157The poll mode allows to use extra columns:
158.RS
159.TP
160.B ACTION
de9501ab 161mount, umount, move or remount action name; this column is enabled by default
a8862fab
KZ
162.TP
163.B OLD-TARGET
164available for umount and move actions
165.TP
166.B OLD-OPTIONS
167available for umount and remount actions
168.RE
4b44c245
BS
169.TP
170.BR \-R , " \-\-submounts"
de9501ab 171Print recursively all submounts for the selected filesystems. The restrictions
049caefd 172defined by options \fB\-t\fP, \fB\-O\fP, \fB\-S\fP, \fB\-T\fP and
de9501ab
BS
173\fB\--direction\fP are not applied to submounts. All submounts are always
174printed in tree-like order. The option enables the tree-like output format by
175default. This option has no effect for \fB\-\-mtab\fP or \fB\-\-fstab\fP.
4b44c245
BS
176.TP
177.BR \-r , " \-\-raw"
469202cd 178Use raw output format. All potentially unsafe characters are hex-escaped (\\x<code>).
4b44c245
BS
179.TP
180.BR \-S , " \-\-source \fIspec\fP"
cd492186
KZ
181Explicitly define the mount source. Supported are \fIdevice\fR, \fImaj:min\fR,
182\fILABEL=\fR, \fIUUID=\fR, \fIPARTLABEL=\fR or \fIPARTUUID=\fR.
4b44c245
BS
183.TP
184.BR \-s , " \-\-fstab"
469202cd
BS
185Search in
186.IR /etc/fstab .
187The output is in the list format (see \fB--list\fR).
4b44c245
BS
188.TP
189.BR \-T , " \-\-target \fIdir\fP"
d0bb6987 190Explicitly define the mount target (mountpoint directory).
4b44c245
BS
191.TP
192.BR \-t , " \-\-types \fIlist\fP"
469202cd
BS
193Limit the set of printed filesystems. More than one type may be
194specified in a comma-separated list. The list of filesystem types can be
195prefixed with
196.I no
197to specify the filesystem types on which no action should be taken. For
198more details see
199.BR mount (8).
4b44c245 200.TP
169b85c9
BV
201.BR \-U , " \-\-uniq"
202Ignore filesystems with duplicate mount targets, thus effectively skipping
203over-mounted mount points.
204.TP
4b44c245 205.BR \-u , " \-\-notruncate"
469202cd
BS
206Do not truncate text in columns. The default is to not truncate the
207.BR TARGET ,
208.BR SOURCE ,
209.BR UUID ,
210.BR LABEL ,
211.BR PARTUUID ,
212.BR PARTLABEL
213columns. This option disables text truncation also in all other columns.
4b44c245
BS
214.TP
215.BR \-v , " \-\-nofsroot"
469202cd 216Do not print a [/dir] in the SOURCE column for bind-mounts or btrfs subvolumes.
4b44c245
BS
217.TP
218.BR \-w , " \-\-timeout \fImilliseconds\fP"
de9501ab 219Specify an upper limit on the time for which \fB--poll\fR will block, in milliseconds.
62b4550f
KZ
220.SH EXAMPLES
221.IP "\fBfindmnt \-\-fstab \-t nfs\fP"
469202cd 222Prints all NFS filesystems defined in
62b4550f
KZ
223.IR /etc/fstab .
224.IP "\fBfindmnt \-\-fstab /mnt/foo\fP"
225Prints all
226.IR /etc/fstab
d0bb6987 227filesystems where the mountpoint directory is /mnt/foo. It also prints bind mounts where /mnt/foo
62b4550f
KZ
228is a source.
229.IP "\fBfindmnt \-\-fstab --target /mnt/foo\fP"
230Prints all
231.IR /etc/fstab
d0bb6987 232filesystems where the mountpoint directory is /mnt/foo.
62b4550f
KZ
233.IP "\fBfindmnt --fstab --evaluate\fP"
234Prints all
235.IR /etc/fstab
236filesystems and converts LABEL= and UUID= tags to the real device names.
582a5006 237.IP "\fBfindmnt -n --raw --evaluate --output=target LABEL=/boot\fP"
d0bb6987 238Prints only the mountpoint where the filesystem with label "/boot" is mounted.
582a5006 239.IP "\fBfindmnt --poll --target /mnt/foo\fP"
469202cd 240Monitors mount, unmount, remount and move on /mnt/foo.
582a5006 241.IP "\fBfindmnt --poll=umount --first-only --target /mnt/foo\fP"
469202cd 242Waits for /mnt/foo unmount.
582a5006
KZ
243.IP "\fBfindmnt --poll=remount -t ext3 -O ro\fP"
244Monitors remounts to read-only mode on all ext3 filesystems.
c0d2c6e1
KZ
245.SH ENVIRONMENT
246.IP LIBMOUNT_FSTAB=<path>
247overrides the default location of the fstab file
248.IP LIBMOUNT_MTAB=<path>
249overrides the default location of the mtab file
68e422ec
KZ
250.IP LIBMOUNT_DEBUG=all
251enables libmount debug output
252.IP LIBSMARTCOLS_DEBUG=all
253enables libsmartcols debug output
62b4550f
KZ
254.SH AUTHORS
255.nf
256Karel Zak <kzak@redhat.com>
257.fi
258.SH SEE ALSO
259.BR mount (8),
260.BR fstab (5)
261.SH AVAILABILITY
601d12fb
KZ
262The findmnt command is part of the util-linux package and is available from
263ftp://ftp.kernel.org/pub/linux/utils/util-linux/.