FINDMNT(8) | System Administration | FINDMNT(8) |
NAME
findmnt - find a filesystem
SYNOPSIS
findmnt [options]
findmnt [options] device|mountpoint
findmnt [options] [--source] device [--target path|--mountpoint mountpoint]
DESCRIPTION
findmnt will list all mounted filesystems or search for a filesystem. The findmnt command is able to search in /etc/fstab, /etc/mtab or /proc/self/mountinfo. If device or mountpoint is not given, all filesystems are shown.
The device may be specified by device name, major:minor numbers, filesystem label or UUID, or partition label or UUID. Note that findmnt follows mount(8) behavior where a device name may be interpreted as a mountpoint (and vice versa) if the --target, --mountpoint or --source options are not specified.
The command-line option --target accepts any file or directory and then findmnt displays the filesystem for the given path.
The command prints all mounted filesystems in the tree-like format by default. The default output, is subject to change. So whenever possible, you should avoid using default output in your scripts. Always explicitly define expected columns by using --output columns-list in environments where a stable output is required.
The relationship between block devices and filesystems is not always one-to-one. The filesystem may use more block devices. This is why findmnt provides SOURCE and SOURCES (pl.) columns. The column SOURCES displays all devices where it is possible to find the same filesystem UUID (or another tag specified in fstab when executed with --fstab and --evaluate).
OPTIONS
-A, --all
-a, --ascii
-b, --bytes
By default, the unit, sizes are expressed in, is byte, and unit prefixes are in power of 2^10 (1024). Abbreviations of symbols are exhibited truncated in order to reach a better readability, by exhibiting alone the first letter of them; examples: "1 KiB" and "1 MiB" are respectively exhibited as "1 K" and "1 M", then omitting on purpose the mention "iB", which is part of these abbreviations.
-C, --nocanonicalize
-c, --canonicalize
-D, --df
-d, --direction word
-e, --evaluate
-F, --tab-file path
-f, --first-only
-H, --list-columns
-I, --dfi
-i, --invert
-J, --json
-k, --kernel
-l, --list
-M, --mountpoint path
-m, --mtab
-N, --task tid
-n, --noheadings
-O, --options list
-o, --output list
The default list of columns may be extended if list is specified in the format +list (e.g., findmnt -o +PROPAGATION).
--output-all
-P, --pairs
Note that SOURCES column, use multi-line cells. In these cases, the column use an array-like formatting in the output, for example name=("aaa" "bbb" "ccc").
-p, --poll[=list]
The time for which --poll will block can be restricted with the --timeout or --first-only options.
The standard columns always use the new version of the information from the mountinfo file, except the umount action which is based on the original information cached by findmnt. The poll mode allows using extra columns:
ACTION
OLD-TARGET
OLD-OPTIONS
--pseudo
--shadow
-R, --submounts
-r, --raw
Note that column SOURCES, use multi-line cells. In these cases, the column may produce more strings on the same line.
--real
-S, --source spec
-s, --fstab
-T, --target path
-t, --types list
--tree
--shadowed
-U, --uniq
-u, --notruncate
-v, --nofsroot
-w, --timeout milliseconds
-x, --verify
--verbose
--vfs-all
-y, --shell
-h, --help
-V, --version
EXIT STATUS
The exit value is 0 if there is something to display, or 1 on any error (for example if no filesystem is found based on the user’s filter specification, or the device path or mountpoint does not exist).
ENVIRONMENT
LIBMOUNT_FSTAB=<path>
LIBMOUNT_MTAB=<path>
LIBMOUNT_DEBUG=all
LIBSMARTCOLS_DEBUG=all
LIBSMARTCOLS_DEBUG_PADDING=on
EXAMPLES
findmnt --fstab -t nfs
findmnt --fstab /mnt/foo
findmnt --fstab --target /mnt/foo
findmnt --fstab --evaluate
findmnt -n --raw --evaluate --output=target LABEL=/boot
findmnt --poll --mountpoint /mnt/foo
findmnt --poll=umount --first-only --mountpoint /mnt/foo
findmnt --poll=remount -t ext3 -O ro
AUTHORS
Karel Zak <kzak@redhat.com>
SEE ALSO
REPORTING BUGS
For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues.
AVAILABILITY
The findmnt command is part of the util-linux package which can be downloaded from Linux Kernel Archive https://www.kernel.org/pub/linux/utils/util-linux/.
2024-07-04 | util-linux 2.40.2 |