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