1FINDMNT(8)                   System Administration                  FINDMNT(8)
2
3
4

NAME

6       findmnt - find a filesystem
7

SYNOPSIS

9       findmnt [options]
10
11       findmnt [options] device|mountpoint
12
13       findmnt [options] [--source] device [--target path|--mountpoint
14       mountpoint]
15

DESCRIPTION

17       findmnt will list all mounted filesystems or search for a filesystem.
18       The findmnt command is able to search in /etc/fstab, /etc/mtab or
19       /proc/self/mountinfo. If device or mountpoint is not given, all
20       filesystems are shown.
21
22       The device may be specified by device name, major:minor numbers,
23       filesystem label or UUID, or partition label or UUID. Note that findmnt
24       follows mount(8) behavior where a device name may be interpreted as a
25       mountpoint (and vice versa) if the --target, --mountpoint or --source
26       options are not specified.
27
28       The command-line option --target accepts any file or directory and then
29       findmnt displays the filesystem for the given path.
30
31       The command prints all mounted filesystems in the tree-like format by
32       default.
33
34       The relationship between block devices and filesystems is not always
35       one-to-one. The filesystem may use more block devices. This is why
36       findmnt provides  SOURCE and SOURCES (pl.) columns. The column SOURCES
37       displays all devices where it is possible to find the same filesystem
38       UUID (or another tag specified in fstab when executed with --fstab and
39       --evaluate).
40

OPTIONS

42       -A, --all
43           Disable all built-in filters and print all filesystems.
44
45       -a, --ascii
46           Use ascii characters for tree formatting.
47
48       -b, --bytes
49           Print the sizes in bytes rather than in a human-readable format.
50
51           By default, the unit, sizes are expressed in, is byte, and unit
52           prefixes are in power of 2^10 (1024). Abbreviations of symbols are
53           exhibited truncated in order to reach a better readability, by
54           exhibiting alone the first letter of them; examples: "1 KiB" and "1
55           MiB" are respectively exhibited as "1 K" and "1 M", then omitting
56           on purpose the mention "iB", which is part of these abbreviations.
57
58       -C, --nocanonicalize
59           Do not canonicalize paths at all. This option affects the comparing
60           of paths and the evaluation of tags (LABEL, UUID, etc.).
61
62       -c, --canonicalize
63           Canonicalize all printed paths.
64
65       --deleted
66           Print filesystems where target (mountpoint) is marked as deleted by
67           kernel.
68
69       -D, --df
70           Imitate the output of df(1). This option is equivalent to -o
71           SOURCE,FSTYPE,SIZE,USED,AVAIL,USE%,TARGET but excludes all pseudo
72           filesystems. Use --all to print all filesystems.
73
74       -d, --direction word
75           The search direction, either forward or backward.
76
77       -e, --evaluate
78           Convert all tags (LABEL, UUID, PARTUUID, or PARTLABEL) to the
79           corresponding device names for the SOURCE column. It’s an unusual
80           situation, but the same tag may be duplicated (used for more
81           devices). For this purpose, there is SOURCES (pl.) column. This
82           column displays by multi-line cell all devices where the tag is
83           detected by libblkid. This option makes sense for fstab only.
84
85       -F, --tab-file path
86           Search in an alternative file. If used with --fstab, --mtab or
87           --kernel, then it overrides the default paths. If specified more
88           than once, then tree-like output is disabled (see the --list
89           option).
90
91       -f, --first-only
92           Print the first matching filesystem only.
93
94       -i, --invert
95           Invert the sense of matching.
96
97       -J, --json
98           Use JSON output format.
99
100       -k, --kernel
101           Search in /proc/self/mountinfo. The output is in the tree-like
102           format. This is the default. The output contains only mount options
103           maintained by kernel (see also --mtab).
104
105       -l, --list
106           Use the list output format. This output format is automatically
107           enabled if the output is restricted by the -t, -O, -S or -T option
108           and the option --submounts is not used or if more that one source
109           file (the option -F) is specified.
110
111       -M, --mountpoint path
112           Explicitly define the mountpoint file or directory. See also
113           --target.
114
115       -m, --mtab
116           Search in /etc/mtab. The output is in the list format by default
117           (see --tree). The output may include user space mount options.
118
119       -N, --task tid
120           Use alternative namespace /proc/<tid>/mountinfo rather than the
121           default /proc/self/mountinfo. If the option is specified more than
122           once, then tree-like output is disabled (see the --list option).
123           See also the unshare(1) command.
124
125       -n, --noheadings
126           Do not print a header line.
127
128       -O, --options list
129           Limit the set of printed filesystems. More than one option may be
130           specified in a comma-separated list. The -t and -O options are
131           cumulative in effect. It is different from -t in that each option
132           is matched exactly; a leading no at the beginning does not have
133           global meaning. The "no" can used for individual items in the list.
134           The "no" prefix interpretation can be disabled by "+" prefix.
135
136       -o, --output list
137           Define output columns. See the --help output to get a list of the
138           currently supported columns. The TARGET column contains tree
139           formatting if the --list or --raw options are not specified.
140
141           The default list of columns may be extended if list is specified in
142           the format +list (e.g., findmnt -o +PROPAGATION).
143
144       --output-all
145           Output almost all available columns. The columns that require
146           --poll are not included.
147
148       -P, --pairs
149           Produce output in the form of key="value" pairs. All potentially
150           unsafe value characters are hex-escaped (\x<code>). See also option
151           --shell.
152
153       -p, --poll[=list]
154           Monitor changes in the /proc/self/mountinfo file. Supported actions
155           are: mount, umount, remount and move. More than one action may be
156           specified in a comma-separated list. All actions are monitored by
157           default.
158
159           The time for which --poll will block can be restricted with the
160           --timeout or --first-only options.
161
162           The standard columns always use the new version of the information
163           from the mountinfo file, except the umount action which is based on
164           the original information cached by findmnt. The poll mode allows
165           using extra columns:
166
167           ACTION
168               mount, umount, move or remount action name; this column is
169               enabled by default
170
171           OLD-TARGET
172               available for umount and move actions
173
174           OLD-OPTIONS
175               available for umount and remount actions
176
177       --pseudo
178           Print only pseudo filesystems.
179
180       --shadow
181           Print only filesystems over-mounted by another filesystem.
182
183       -R, --submounts
184           Print recursively all submounts for the selected filesystems. The
185           restrictions defined by options -t, -O, -S, -T and --direction are
186           not applied to submounts. All submounts are always printed in
187           tree-like order. The option enables the tree-like output format by
188           default. This option has no effect for --mtab or --fstab.
189
190       -r, --raw
191           Use raw output format. All potentially unsafe characters are
192           hex-escaped (\x<code>).
193
194       --real
195           Print only real filesystems.
196
197       -S, --source spec
198           Explicitly define the mount source. Supported specifications are
199           device, maj:min, LABEL=label, UUID=uuid, PARTLABEL=label and
200           PARTUUID=uuid.
201
202       -s, --fstab
203           Search in /etc/fstab. The output is in the list format (see
204           --list).
205
206       -T, --target path
207           Define the mount target. If path is not a mountpoint file or
208           directory, then findmnt checks the path elements in reverse order
209           to get the mountpoint (this feature is supported only when
210           searching in kernel files and unsupported for --fstab). It’s
211           recommended to use the option --mountpoint when checks of path
212           elements are unwanted and path is a strictly specified mountpoint.
213
214       -t, --types list
215           Limit the set of printed filesystems. More than one type may be
216           specified in a comma-separated list. The list of filesystem types
217           can be prefixed with no to specify the filesystem types on which no
218           action should be taken. For more details see mount(8).
219
220       --tree
221           Enable tree-like output if possible. The options is silently
222           ignored for tables where is missing child-parent relation (e.g.,
223           fstab).
224
225       --shadowed
226           Print only filesystems over-mounted by another filesystem.
227
228       -U, --uniq
229           Ignore filesystems with duplicate mount targets, thus effectively
230           skipping over-mounted mount points.
231
232       -u, --notruncate
233           Do not truncate text in columns. The default is to not truncate the
234           TARGET, SOURCE, UUID, LABEL, PARTUUID, PARTLABEL columns. This
235           option disables text truncation also in all other columns.
236
237       -v, --nofsroot
238           Do not print a [/dir] in the SOURCE column for bind mounts or btrfs
239           subvolumes.
240
241       -w, --timeout milliseconds
242           Specify an upper limit on the time for which --poll will block, in
243           milliseconds.
244
245       -x, --verify
246           Check mount table content. The default is to verify /etc/fstab
247           parsability and usability. It’s possible to use this option also
248           with --tab-file. It’s possible to specify source (device) or target
249           (mountpoint) to filter mount table. The option --verbose forces
250           findmnt to print more details.
251
252       --verbose
253           Force findmnt to print more information (--verify only for now).
254
255       --vfs-all
256           When used with VFS-OPTIONS column, print all VFS (fs-independent)
257           flags. This option is designed for auditing purposes to list also
258           default VFS kernel mount options which are normally not listed.
259
260       -y, --shell
261           The column name will be modified to contain only characters allowed
262           for shell variable identifiers. This is usable, for example, with
263           --pairs. Note that this feature has been automatically enabled for
264           --pairs in version 2.37, but due to compatibility issues, now it’s
265           necessary to request this behavior by --shell.
266
267       -h, --help
268           Display help text and exit.
269
270       -V, --version
271           Print version and exit.
272

EXIT STATUS

274       The exit value is 0 if there is something to display, or 1 on any error
275       (for example if no filesystem is found based on the user’s filter
276       specification, or the device path or mountpoint does not exist).
277

ENVIRONMENT

279       LIBMOUNT_FSTAB=<path>
280           overrides the default location of the fstab file
281
282       LIBMOUNT_MTAB=<path>
283           overrides the default location of the mtab file
284
285       LIBMOUNT_DEBUG=all
286           enables libmount debug output
287
288       LIBSMARTCOLS_DEBUG=all
289           enables libsmartcols debug output
290
291       LIBSMARTCOLS_DEBUG_PADDING=on
292           use visible padding characters.
293

EXAMPLES

295       findmnt --fstab -t nfs
296           Prints all NFS filesystems defined in /etc/fstab.
297
298       findmnt --fstab /mnt/foo
299           Prints all /etc/fstab filesystems where the mountpoint directory is
300           /mnt/foo. It also prints bind mounts where /mnt/foo is a source.
301
302       findmnt --fstab --target /mnt/foo
303           Prints all /etc/fstab filesystems where the mountpoint directory is
304           /mnt/foo.
305
306       findmnt --fstab --evaluate
307           Prints all /etc/fstab filesystems and converts LABEL= and UUID=
308           tags to the real device names.
309
310       findmnt -n --raw --evaluate --output=target LABEL=/boot
311           Prints only the mountpoint where the filesystem with label "/boot"
312           is mounted.
313
314       findmnt --poll --mountpoint /mnt/foo
315           Monitors mount, unmount, remount and move on /mnt/foo.
316
317       findmnt --poll=umount --first-only --mountpoint /mnt/foo
318           Waits for /mnt/foo unmount.
319
320       findmnt --poll=remount -t ext3 -O ro
321           Monitors remounts to read-only mode on all ext3 filesystems.
322

AUTHORS

324       Karel Zak <kzak@redhat.com>
325

SEE ALSO

327       fstab(5), mount(8)
328

REPORTING BUGS

330       For bug reports, use the issue tracker at
331       https://github.com/util-linux/util-linux/issues.
332

AVAILABILITY

334       The findmnt command is part of the util-linux package which can be
335       downloaded from Linux Kernel Archive
336       <https://www.kernel.org/pub/linux/utils/util-linux/>.
337
338
339
340util-linux 2.38                   2022-02-17                        FINDMNT(8)
Impressum