Kahibaro
Discord Login Register

Overview of the root filesystem

Why the Filesystem Matters in Linux

In Linux, everything is organized inside a single tree that starts at the root directory, written as /. This is called the root filesystem.

There are no separate “drives” like C: or D: in Windows. All disks, partitions, USB sticks, and network shares are attached (mounted) somewhere under /.

This chapter gives you a big-picture view of that tree so you can make sense of paths you see in commands, documentation, and error messages.

You will later learn about specific important directories in their own chapter; here we stay at the “map level” and avoid deep dives into any single directory.

The Root Directory `/`

The top of the Linux filesystem is the root directory, written as a single slash: /.

Everything is located under /, for example:

There is no filename above /. If you see a path like /home/alex/file.txt, you can think of it as:

Basic Structure: The High-Level “Neighborhoods”

You don’t need to memorize everything at once. It helps to think of the root filesystem as grouped into a few main “neighborhoods”:

  1. System essentials (boot and core programs)
    These are needed for the system to start and run at a basic level:
    • /boot – files needed to boot the system (bootloader, kernel images).
    • /bin – essential user commands needed in single-user or emergency mode.
    • /sbin – essential system administration commands.
    • /lib, /lib64 – essential shared libraries used by programs in /bin and /sbin.
  2. User data and applications
    • /home – home directories for regular users.
    • /root – home directory for the root (administrator) user.
    • /usr – most user-space software, libraries, documentation, etc.
    • /opt – optional, often third-party or self-contained software packages.
  3. Configuration and variable data
    • /etc – system-wide configuration files.
    • /var – variable data that changes over time (logs, caches, mail queues, etc).
  4. Temporary storage
    • /tmp – temporary files, usually safe to delete and often cleaned automatically.
  5. Devices and virtual filesystems
    • /dev – special files representing hardware and virtual devices.
    • /proc – virtual filesystem exposing process and kernel information.
    • /sys – virtual filesystem exposing kernel and device information.
    • /run – runtime data (like PID files, sockets) valid only while the system is running.
  6. Mount points
    • /mnt – traditionally used for temporarily mounting filesystems.
    • /media – typically used for removable media (USB drives, CDs, etc.).
    • Other mount points can be anywhere (for example /srv/data or /data).

You will meet many of these directories again in their own subchapters later.

Filesystem Hierarchy Standard (FHS)

Most Linux distributions follow a common guideline called the Filesystem Hierarchy Standard (FHS). FHS describes:

Not all distributions follow FHS perfectly, but the broad structure is similar enough that once you learn it on one distribution, you can navigate most others.

How the Tree Works: An Example Path

Consider the path:

/usr/share/doc/bash/README

Breaking it down:

Conceptually, this is exactly like nested folders in a graphical file manager, but represented as a single string with / separators.

Multiple Filesystems, One Tree

On many systems, different parts of the tree live on different partitions or disks, but they are all still seen as one tree under /.

For example, a system might be organized like:

From a user’s perspective, paths still look like:

You don’t see “drives” changing; you just move around one big tree.

System vs. User Areas

A key concept in the root filesystem is the distinction between “system-owned” areas and “user-owned” areas:

There are also “shared” or “service” areas like /srv, which are intended for data provided by services (e.g., web or FTP servers), usually managed by an administrator.

Viewing the Root Filesystem

Once you have a terminal, you can look at the top level of the filesystem:

ls /

You will typically see something like (contents vary by distribution):

bin   boot  dev  etc  home  lib  lib64  media  mnt  opt
proc  root  run  sbin  srv  sys  tmp  usr  var

You can then explore, for example:

ls /home
ls /etc
ls /var

At this stage, you don’t need to understand everything you see. The goal is to become familiar with the layout and recognize the common top-level directories.

Summary: What to Take Away

In the next chapters, you’ll examine specific important directories under / in more detail.

Views: 26

Comments

Please login to add a comment.

Don't have an account? Register now!