Linux online course

Linux File Systems: Structure, Mounting, and Common Types

Learn how Linux file systems organize data, how disks and partitions are mounted into one directory tree, and how to inspect supported and mounted file systems.

A file system is the set of rules and data structures used to organize, name, store, locate, retrieve, and manage data on a storage medium. It defines how files and directories are recorded and how the operating system finds them.

A file system also stores metadata, which is information about files rather than their contents. Metadata can include a file's size, owner, permissions, timestamps, and the locations of its data. Directories provide names and organization, while permissions help control access.

File Systems, Disks, Partitions, and Directories

These terms describe different layers of storage:

ConceptWhat it representsExampleRelationship to the directory tree
DiskA physical or virtual storage device.An SSD, hard disk, or virtual disk.May contain one or more partitions.
PartitionA logical subdivision of a disk./dev/sda2 or a partition on a virtual disk.Can contain a file system that is later mounted into the tree.
File systemThe structures and rules used to organize data.ext4 or XFS.Provides files and directories when accessed through a mount point.
Mount pointA directory where a file system is attached./home or /boot.Becomes the access location for the mounted file system.
DirectoryA container that maps names to files and other directories./home/alex/Documents.Forms part of the hierarchical directory tree.

A disk can contain multiple partitions. A partition is commonly formatted, meaning a file system is created on it. Formatting creates the structures needed to store files; it does not simply erase files by changing their names. Creating a file system can destroy existing data on the target partition, so it must be done carefully.

Linux's Single Directory Tree

Linux starts with one top-level directory called the root directory, represented by a forward slash: /. Every accessible path belongs somewhere below this root.

                  /
        __________|________________
       /       /       /      \
    /boot    /home    /etc    /var
                |
              /alex

This nested arrangement is called the directory tree. For example, /home/alex is a path that begins at /, enters home, and then enters alex.

Linux does not normally expose separate top-level drive-letter roots such as C: and D:. On systems that use drive letters, a second disk or partition may appear as a separate root. Linux instead attaches additional storage somewhere in the existing tree. A second partition might be mounted at /home, making its files available under paths such as /home/alex.

Mounting and Mount Points

To mount a file system means to make it accessible at a directory in the existing Linux hierarchy. The directory used for this attachment is the mount point.

Consider a conceptual system with three partitions:

  • A root file system mounted at /.
  • A separate file system mounted at /boot for boot-related files.
  • A separate file system mounted at /home for user data.

The partitions remain separate storage areas, but users access them through ordinary paths in one tree. The contents of the file system mounted at /home appear under /home; the contents of the file system mounted at /boot appear under /boot.

Linux can mount a file system over an existing directory. If that directory already contains files, those files are temporarily hidden while the mount is active. They are not normally deleted. After the file system is unmounted, meaning detached from the tree, the original directory contents become visible again.

Common Linux File System Types

Linux supports many file systems, including local disk file systems, network file systems, virtual file systems, and removable-media formats. The following list is common but not exhaustive.

File systemJournalingTypical characteristicsCurrent usage guidance
ext2NoOlder Linux extended file system with a simple design and no journal.Mostly encountered on older systems or special use cases; not a typical default for new general-purpose installations.
ext3YesSuccessor to ext2 that added journaling while retaining much of its structure.Historically important, but commonly replaced by ext4 on newer installations.
ext4YesModern extended file system with improved scalability and reliability features compared with earlier ext variants.A common general-purpose baseline when supported by the distribution and workload.
ReiserFSYesHistorically important Linux file system with journaling and design choices focused partly on handling many small files.Generally not the preferred choice for new deployments.
XFSYesHigh-performance, scalable journaling file system often associated with large files and large storage volumes.Consider it for workloads involving large-scale storage, subject to distribution and operational requirements.
JFSYesJournaling file system originally developed by IBM and available on Linux.Useful where its supported features and operational characteristics fit the environment.

How to Choose a File System

There is no universally best file system. Consider the Linux distribution, kernel and tool support, expected file sizes, storage capacity, performance requirements, recovery behavior, backup strategy, and administrator experience.

For a general-purpose Linux installation, ext4 is often a reasonable baseline. XFS may be a strong candidate when the workload emphasizes very large files or large storage volumes. The choice should be tested against the actual workload rather than made from the name alone.

Journaling

Journaling records pending file-system changes, especially metadata changes, in a journal before or while those changes are applied. If the system loses power or shuts down unexpectedly, the file system can use the journal to recover more quickly and consistently.

ext2 is the useful comparison point because it does not use journaling. ext3, ext4, XFS, and JFS are journaled examples. Journaling improves file-system consistency and recovery behavior, but it is not a backup. It cannot protect against accidental deletion, malware, disk failure, or every kind of corruption. Important data still needs a separate backup strategy.

Discovering File Systems Supported by the Running Kernel

The virtual file /proc/filesystems reports file-system types known to the currently running kernel. It is provided through procfs, a virtual file system that exposes kernel and process information through files and directories.

cat /proc/filesystems

Example output may include entries resembling these:

nodev   sysfs
nodev   proc
nodev   tmpfs
        ext4
        xfs

The nodev marker means that the file-system type does not require a block-device backing store. Such file systems are often virtual, pseudo, or network-oriented. For example, proc exposes process and kernel information, while sysfs exposes kernel device and system-object information.

nodev does not mean that a physical device is waiting to be connected. Compare a nodev type such as proc with a device-backed type such as ext4: the former provides a virtual interface, while the latter normally organizes data on a partition or other block device.

Inspecting File Systems That Are Currently Mounted

Supported file-system types and mounted file systems answer different questions. The output of /proc/filesystems describes types the kernel knows about. It does not say that every listed type is currently in use.

QuestionCommand or sourceWhat the result means
Which types can the kernel support?cat /proc/filesystemsLists file-system types known to the running kernel, including nodev types.
Which file systems are mounted now?findmntShows mounted sources, file-system types, and mount points in a structured view.
What type is mounted at a particular path?findmnt -T /homeIdentifies the file system mounted at, or containing, /home.

Useful Inspection Commands

# Display mounted file systems in a structured tree or table
findmnt

# Find the file system containing /home
findmnt -T /home

# Show mounted file systems, types, and space usage
df -T

# Show block devices, partitions, types, labels, UUIDs, and mount points
lsblk -f

# Display mounted file systems; findmnt is often clearer on modern systems
mount

findmnt is useful for understanding the relationship between a source device, its file-system type, and its mount point. df -T combines file-system type information with capacity and usage. lsblk -f starts from block devices and shows how partitions relate to file systems and mount points.

Troubleshooting Common Misunderstandings

“Every Linux disk should have its own drive letter”

Linux integrates mounted storage beneath the single root directory instead of assigning separate drive-letter roots. Use lsblk -f to see devices and partitions, then use findmnt to see where active file systems appear, such as /home.

“nodev means the device is missing”

nodev describes a file-system type that does not need a block device. Compare a nodev entry such as proc with a device-backed entry such as ext4. Their purposes are different; neither interpretation means that a physical device is waiting to be attached.

“Files in a mount-point directory disappeared”

Mounting over a nonempty directory hides the directory's original visible contents. Check the active mount with findmnt -T /path. If appropriate and safe, unmount the file system to reveal the underlying contents again.

“/proc/filesystems lists only active file systems”

It lists types supported by the running kernel, not only types currently mounted. Use findmnt, mount, or df -T to inspect active mounts.

Exam-Ready Summary

  • A file system defines how data and metadata are organized and accessed.
  • A disk is a storage device; a partition is a subdivision of that device; a file system is created on a partition or other storage source.
  • Linux uses one directory tree beginning at /, rather than normally using drive-letter roots.
  • Mounting attaches a file system to a directory, and that directory is its mount point.
  • Mounting over a nonempty directory temporarily hides the directory's original contents.
  • ext2 is non-journaled; ext3 added journaling; ext4 is a common modern extended file system.
  • ReiserFS is historically important but generally not preferred for new deployments; XFS is associated with scalable, large-storage workloads; JFS is IBM's journaled file system available on Linux.
  • Journaling supports faster and more consistent recovery after unexpected shutdowns, but it does not replace backups.
  • /proc/filesystems shows kernel-known types. A nodev marker means no block-device backing store is required.
  • Use findmnt and df -T for mounted file systems, and lsblk -f to relate block devices to file systems and mount points.

For related background, review Linux file structure, determining file types, and other Linux lessons.