A filesystem is one of those things we use every single day without thinking about it. We create a file, rename it, delete it, move it into a folder and somehow the computer always knows where the hell everything is. But what is actually happening underneath?

So let’s start with an SSD that knows absolutely nothing about photo.jpg, /home/baxrom, permissions, folders or any of that fancy stuff, and build the idea from there.

1. So what problem does a filesystem solve?

Let’s say our SSD has a ton of space. At the lowest useful level for us, it gives the operating system numbered places where data can be read and written. But the SSD itself does not understand this: /home/baxrom/photo.jpg
It does not know:

Those are ideas created by the filesystem.

So basically:

raw storage
    ↓
filesystem adds structure
    ↓
files + names + folders + metadata + free-space tracking

A filesystem is the layer that turns a bunch of storage addresses into something humans and programs can actually work with.

And it has two big jobs:

  1. remember what exists and where its bytes are
  2. remember which space is already used and which is still free

Everything else in this article slowly grows from those two problems.


2. Before the file: sectors, partitions and blocks