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