One tree, many filesystems
Unix presents every file under one root directory, /. Nothing in the path tells you where the bytes actually live. A file under /home may be on a disk partition, /tmp may be in RAM, and /proc may not be stored anywhere at all. The system stitches these together with mounts. A mount attaches a filesystem, which is a tree of files and directories, at an existing directory called the mount point.
After a mount, the directory at the mount point shows the contents of the mounted filesystem. The files that were in that directory before the mount are hidden, not deleted, and they reappear when the filesystem is unmounted. This is why a directory that seems empty can still hold data, and why you should check the mount table when a path behaves strangely.
The mount table
The kernel records the mounts that are active in /proc/mounts. Each line has six fields: the source device or name, the mount point, the filesystem type, the mount options, and two legacy fields used by dump and fsck. The file is read-only and always current, which makes it more reliable than the older /etc/mtab that some systems keep for compatibility.
awk '$2 == "/" || $2 == "/tmp" { print $2, $3 }' /proc/mountsThe command prints the mount point and the filesystem type for the root directory and for /tmp. In the lab, / is an overlay filesystem and /tmp is a tmpfs. The next lesson explains both. The field you usually need is the third one, the type, because the type tells you the behavior: whether data survives a reboot, whether writes are allowed, and whether the filesystem is backed by a real disk at all.
Finding the filesystem for a path
Given any path, you can ask which filesystem holds it. The findmnt tool from util-linux does this directly. With -T it walks up from the path to the nearest mount point, and with -n and -o it prints only the columns you choose.
findmnt -n -o TARGET,SOURCE,FSTYPE -T /workspaceIn the lab the answer for /workspace is the root mount, because the home directory is not a separate mount. This is an important point. A directory is not a mount just because it is in your home. Only entries in the mount table are mounts.
The lab has no mount permission for your user. Read the table and learn the commands, but do not try to attach a filesystem yourself. Attaching a filesystem needs root, and on a real system the same mount table is changed by the init system or by /etc/fstab at boot.
Options that change behavior
The options field controls how a mounted filesystem behaves. The most common are ro for read-only, rw for read-write, noexec to forbid running programs from it, and nosuid to ignore set-user-ID bits. A read-only option applies even to root. If a filesystem is mounted ro, no write system call succeeds on it until it is remounted, regardless of the file permission bits.
You can read the options of the root mount with one short pipeline. The output is long, because overlay options list directory paths, so the lesson shows only the field count.
awk '$2 == "/" { print NF, $4 }' /proc/mounts | cut -c1-80Mounts that come from configuration
Most mounts made at boot come from a file named /etc/fstab. Each line describes one mount: the device or label, the mount point, the filesystem type, the options, and the order in which checks run. The init system reads the file and performs each mount, so the table you see after boot reflects both the file and any mounts someone made by hand since then.
Editing that file is a privileged change with real consequences. A wrong entry can stop a machine from booting, and a wrong option can make a filesystem read-only with no warning in the programs that use it. Reading the file is harmless, and it tells you what the machine intends to have mounted. Comparing it with the live table is the fastest way to find a mount that failed or was never attempted.
A mount listed in the file but absent from the table means the mount failed or did not run. A mount present in the table but absent from the file was made by hand, or by a program that calls mount itself. Both cases are easy to see with two read-only commands whose output you can compare.
cat /etc/fstab 2>/dev/null | head -5
wc -l < /proc/mountsThe first command prints the start of the file if it exists, and the second counts the live mounts. Neither one changes anything, which is the kind of inspection you should always do before a change.
Filesystems are not the same as disks
The source column in the mount table is not always a device. For tmpfs the source is the word tmpfs, and for overlay it is the word overlay. Both are filesystems implemented in software. A tmpfs keeps its files in memory and a filesystem like ext4 keeps them on a block device, but both are mounted and checked in the same way. When you see a filesystem type, read it as a description of how the data is stored and how the kernel handles requests for it.
Hands-on: read the mount table
Use the mount table to answer two questions: what filesystem holds the root, and what filesystem holds /tmp. Compare the answer with what findmnt reports for the same paths. Two independent sources agreeing is the habit that catches mistakes.
findmnt -n -o TARGET,FSTYPE / /tmp
awk '$2 == "/tmp" { print $3 }' /proc/mountsThe root line shows overlay and the /tmp line shows tmpfs. The two commands read different sources, the mount table through the kernel and the findmnt library, and they agree because they describe the same kernel state.