Verify mounts with findmnt command
In this step, you will use the findmnt
command, which is another powerful tool for displaying information about mounted file systems. findmnt
is often considered more user-friendly and provides a tree-like view of the mount points.
The findmnt
command queries the /etc/fstab
, /etc/mtab
, or /proc/self/mountinfo
files. It can display the mount points in a hierarchical way, making it easier to understand the relationships between different file systems.
Type the following command in your terminal and press Enter:
findmnt
You will see output similar to this:
TARGET SOURCE FSTYPE OPTIONS
/ overlay overlay rw,relatime,...
|-/proc proc proc rw,nosuid,nodev,noexec,relatime
| |-/proc/asound tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=...
| |-/proc/acpi tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=...
| |-/proc/scsi tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=...
| `-/proc/kcore tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=...
|-/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
| `-/sys/fs/cgroup tmpfs tmpfs ro,nosuid,nodev,noexec,relatime,size=...
| `-systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,xattr,...
|-/dev tmpfs tmpfs rw,nosuid,size=...,mode=755
| |-/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=...,mode=...
| `-/dev/shm tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=...
|-/etc/hosts /dev/sda1 ext4 rw,relatime
`-...
The output shows the mount points in a tree structure.
TARGET
: The mount point directory.
SOURCE
: The device or source of the file system.
FSTYPE
: The file system type.
OPTIONS
: The mount options.
You can also use findmnt
to check if a specific file system is mounted. For example, to check if the root file system (/
) is mounted, you can use:
findmnt /
This will show the details for the root mount point if it exists.
The findmnt
command provides a clear and organized way to view your system's mount points, which is very helpful for system administration and troubleshooting.
Click Continue to complete this lab.