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