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