Skip to content

Linux Filesystems and Mounts for Beginners

Linux presents files through one directory tree that starts at /. A disk or network filesystem becomes available in that tree when it is mounted at a directory called a mount point. The drive-letter model used by Windows does not apply: /home, /var, and a removable disk can all be directories in the same tree while residing on different filesystems.

Linux directory tree showing common system directories and a separate filesystem mounted at /mnt/data

Linux filesystem view: a mounted filesystem appears at a directory in the single tree rooted at /.


Step 1: Recognize Common Directories

01

Read a Linux Path from the Root

Directory Tree

A leading slash means the path starts at the filesystem root. These directories are common on Linux systems; exact contents can differ by distribution and installed software.

Terminal window
pwd
ls -lah /
❯ View Expected Console Output
/ Top of the directory tree
/home Users' home directories
/etc System and service configuration
/var Variable data such as logs and caches
/tmp Temporary files
/usr and /opt Installed operating-system and optional software
/mnt and /media Common locations for mounted or removable filesystems

Step 2: Inspect Disks, Filesystems, and Free Space

02

Check Devices and Mounted Filesystems

Read-Only Inventory

These commands inspect storage. lsblk shows block devices and mount points, findmnt shows the mounted tree, and df reports filesystem capacity. A device such as /dev/sdb may contain more than one partition; do not guess which device to mount or format.

Terminal window
lsblk -o NAME,TYPE,SIZE,FSTYPE,LABEL,UUID,MOUNTPOINTS
findmnt
df -hT
❯ View Expected Console Output
NAME TYPE SIZE FSTYPE LABEL UUID MOUNTPOINTS
vda disk 40G
├─vda1 part 1G vfat 7A1B-2C3D /boot/efi
└─vda2 part 39G ext4 9b6c... /
Filesystem Type Size Used Avail Use% Mounted on
/dev/vda2 ext4 39G 12G 25G 33% /

Step 3: See Which Filesystem Contains a Path

03

Check Space for a Directory or File

Capacity

findmnt —target identifies the mount that contains a path. df -hT shows its filesystem capacity; du -sh estimates how much space a directory’s contents use. du may take time on large trees and access to some files may be denied.

Terminal window
findmnt --target "$HOME"
df -hT "$HOME"
du -sh "$HOME"
❯ View Expected Console Output
TARGET SOURCE FSTYPE OPTIONS
/home /dev/vda2 ext4 rw,relatime
Filesystem Type Size Used Avail Use% Mounted on
/dev/vda2 ext4 39G 12G 25G 33% /
3.4G /home/sam

Step 4: Understand a Mount Point

04

Find a Device by Its UUID Before Mounting

Mounting

A mount point is an existing directory where the root of another filesystem becomes visible. First identify the intended filesystem and its UUID with lsblk; compare the size, label, filesystem type, and UUID with your change plan. Never use an example device name blindly.

Terminal window
lsblk -f
# Replace the placeholder with the UUID you confirmed from lsblk.
sudo mkdir -p /mnt/data
sudo mount UUID=REPLACE-WITH-CONFIRMED-UUID /mnt/data
findmnt --target /mnt/data
❯ View Expected Console Output
TARGET SOURCE FSTYPE OPTIONS
/mnt/data /dev/disk/by-uuid/confirmed-filesystem-id ext4 rw,relatime

Step 5: Unmount and Plan Persistent Mounts Carefully

05

Unmount Only After Checking for Active Use

Change Safety

Before unmounting, leave the mount point and close programs using files on it. Check it with findmnt; if umount says the filesystem is busy, identify the users instead of forcing it. Entries in /etc/fstab configure filesystems to be mounted later, including at boot, so mistakes can affect startup.

Terminal window
cd /
findmnt --target /mnt/data
sudo umount /mnt/data
findmnt --target /mnt/data
❯ View Expected Console Output
After unmounting, findmnt --target /mnt/data reports the parent filesystem,
because /mnt/data is now an ordinary directory again.

References

Comments