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. The default output, is subject to change. So whenever
33       possible, you should avoid using default output in your scripts. Always
34       explicitly define expected columns by using --output columns-list in
35       environments where a stable output is required.
36
37       The relationship between block devices and filesystems is not always
38       one-to-one. The filesystem may use more block devices. This is why
39       findmnt provides  SOURCE and SOURCES (pl.) columns. The column SOURCES
40       displays all devices where it is possible to find the same filesystem
41       UUID (or another tag specified in fstab when executed with --fstab and
42       --evaluate).
43

OPTIONS

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

EXIT STATUS

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

ENVIRONMENT

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

EXAMPLES

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

AUTHORS

327       Karel Zak <kzak@redhat.com>
328

SEE ALSO

330       fstab(5), mount(8)
331

REPORTING BUGS

333       For bug reports, use the issue tracker at
334       https://github.com/util-linux/util-linux/issues.
335

AVAILABILITY

337       The findmnt command is part of the util-linux package which can be
338       downloaded from Linux Kernel Archive
339       <https://www.kernel.org/pub/linux/utils/util-linux/>.
340
341
342
343util-linux 2.39.2                 2023-06-14                        FINDMNT(8)
Impressum