Tech●●●●●Difficulty 3 of 5

How does a computer find your file among millions?

The word "file system" is older than computers: it began as a way of organising paper in cabinets.

▶ Start the story

A computer finds your file because a file system keeps an organised record of where everything is. A file system governs how files are organised and accessed, and it is a service of the operating system. Without it, programs could use the disk in incompatible ways that lead to contention, corrupted data and data loss.

The name has a charming past. Long before computers, from around 1900, "file system" meant a way of organising, storing and retrieving paper documents. By 1961 the term was being applied to computerised filing too, and the folders and files on your screen still echo it.

Here is how it works. A file system groups files into directories, also called folders, and a file name has to be unique only within its own folder, so two folders can each hold a file with the same name. Beside the contents, the system stores , such as who owns a file and what permissions it has, and it keeps that metadata separate from the file's content. The system also tracks which areas of the storage belong to which file and which are unused.

When you delete a file, the file system records that the file's space is free for another file to use. Under all of this, a lower layer reads and writes blocks on the disk through the device driver, so you never have to know where on the disk anything lives.

256 bytes

Average space wasted per file when space is handed out in 512-byte chunks
From a file name to the disk
  1. Step 1: Logical layer

    Open, close, read, write by file name

  2. Step 2: Directories and

    Which blocks belong to this file, and who may use them

  3. Step 3: Physical layer

    Reads and writes data blocks on the device

  4. Step 4: Device driver

    Speaks the disk's own language

  5. Step 5: Storage device

    Hard drive, solid-state drive and others

Quiz me

0/3

  1. 1.What problem does a file system solve?
  2. 2.What does the file system do when you delete a file?
  3. 3.Why can two different folders both contain a file called report.txt?

Recap

A file system maps names and folders to blocks on the disk and keeps notes (metadata) about each file.

💡 A trick to remember it · A librarian who knows each book's name, its shelf and who may borrow it, and writes all three on a card.

Surprising fact · The term 'file system' described paper filing around 1900, long before computers.

Sources (1)

No source, no claim. Every fact in this lesson (16 claims) cites at least one of these.

  1. [1]File system · Wikipedia
More lessons in 💻 Tech (3) See all tech lessons →

One more light on your map.

Get one lesson like this every day, about the things you love. Free, in two or five minutes.

Get the share card for this lesson ↗