DESCRIPTION
‘findmnt’ will list all mounted filesytems 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, maj:min, filesystem LABEL or UUID, or partition PARTUUID or PARTLABEL. Note that a device name may be interpreted as a mount?point (and vice versa) if the –target or –source options are not specified. The command prints all mounted filesystems in the tree-like format by default.
Install findmnt:
The command findmnt comes in the package util-linux-ng, now renamed util-linux. The package comes with several other utilities such as hwclock. To install findmnt download util-linux from kernel.org ftp page. It can also be installed using:
yum install util-linux-ng
Standard ‘mount’ output:
root@host [~]# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=908348k,nr_inodes=227087,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/vda3 on / type ext4 (rw,relatime,data=ordered,jqfmt=vfsv0,usrjquota=quota.user)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=24,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=183500k,mode=700)
root@host [~]#
Standard ‘findmnt’ output:
root@host [~]# which findmnt
/usr/bin/findmnt
root@host# findmnt
TARGET SOURCE FSTYPE OPTIONS
/ /dev/vda3 ext4 rw,relatime,data=ordered,jqfmt=vfsv0,usrjqu
??/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
? ??/sys/kernel/security securityfs securityf rw,nosuid,nodev,noexec,relatime
? ??/sys/fs/cgroup tmpfs tmpfs ro,nosuid,nodev,noexec,mode=755
? ? ??/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,xattr,relea
? ? ??/sys/fs/cgroup/perf_event cgroup cgroup rw,nosuid,nodev,noexec,relatime,perf_event
? ? ??/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu
? ? ??/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer
? ? ??/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio
? ? ??/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset
? ? ??/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices
? ? ??/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory
? ? ??/sys/fs/cgroup/hugetlb cgroup cgroup rw,nosuid,nodev,noexec,relatime,hugetlb
? ? ??/sys/fs/cgroup/net_cls cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls
? ??/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec,relatime
? ??/sys/kernel/debug debugfs debugfs rw,relatime
? ??/sys/kernel/config configfs configfs rw,relatime
??/proc proc proc rw,nosuid,nodev,noexec,relatime
? ??/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=24,pgrp=1,timeout=300,minpro
??/dev devtmpfs devtmpfs rw,nosuid,size=908348k,nr_inodes=227087,mod
? ??/dev/shm tmpfs tmpfs rw,nosuid,nodev
? ??/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,pt
? ??/dev/mqueue mqueue mqueue rw,relatime
? ??/dev/hugepages hugetlbfs hugetlbfs rw,relatime
??/run tmpfs tmpfs rw,nosuid,nodev,mode=755
??/run/user/0 tmpfs tmpfs rw,nosuid,nodev,relatime,size=183500k,mode=
root@host [~]#
Usage:
findmnt [options]
findmnt [options]
findmnt [options]
findmnt [options] [--source
Options:
– smkpwAacDdeFfilNnuOoPrtvRS
There is more information about these options which can be found in the man page.
Useful Example:
findmnt --fstab -t nfs
Prints all NFS filesystems defined in /etc/fstab.
findmnt --fstab /mnt/foo
Prints all /etc/fstab filesystems where the mountpoint directory is /mnt/foo.
It also prints bind mounts where /mnt/foo is a source.
findmnt --fstab --target /mnt/foo
Prints all /etc/fstab filesystems where the mountpoint directory is /mnt/foo.
findmnt --fstab --evaluate
Prints all /etc/fstab filesystems and converts LABEL= and UUID= tags to the real
device names.
findmnt -n --raw --evaluate --output=target LABEL=/boot
Prints only the mountpoint where the filesystem with label “/boot” is mounted.
findmnt --poll --target /mnt/foo
Monitors mount, unmount, remount and move on /mnt/foo. Any changes made to /proc/self/mountinfo file will automatically be updated on the terminal.
findmnt --poll=umount --first-only --target /mnt/foo
Waits for /mnt/foo unmount.
findmnt --poll=remount -t ext3 -O ro
Monitors remounts to read-only mode on all ext3 filesystems.
Read file systems from fstab:
findmnt -s
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mapper/fedora-root ext4 defaults
/boot UUID=18cde604-1c65-4ec8-8a8d-385df50ada3b ext4 defaults
swap /dev/mapper/fedora-swap swap defaults
Filter filesystems by type: Findmnt can print out only specific file systems based on the type, for example ext4.$ findmnt -t ext4
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mapper/fedora-root ext4 rw,relatime,seclabel,data=ordered
??/boot /dev/sda1 ext4 rw,relatime,seclabel,data=ordered
Search by mount point: To search file system by the mount directory , specify the directory with or without the ‘-T’/’–target’ option.
$ findmnt -T /
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mapper/fedora-root ext4 rw,relatime,seclabel,data=ordered
$ findmnt -T /media/4668484A68483B47
TARGET SOURCE FSTYPE OPTIONS
/media/4668484A68483B47 /dev/sda5 fuseblk rw,nosuid,nodev,relatime,user_id=0
Enjoy!