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