LightMySky

File Systems: Names, Blocks and Metadata

A file system turns a flat array of blocks into names, directories and permissions. An inode or equivalent record holds where the blocks are and who may touch them, while the directory is just a table mapping names to those records.

No account needed. Progress saves in this browser.

What a learner can do afterwards

  • Follow a path name to the blocks that hold the file's bytes
  • Explain what a hard link is in terms of the record it points at
  • Say why deleting a large file can be instant while writing it was slow

1 · Read

A path name is a map that walks from the top of the file system, folder by folder, to one exact file. Each folder is a table that points to the next folder down the chain. When you type a path, you spell out exactly that walk, until the last name points at the file itself.

Try it together

Type ls -l and you may see -rw-r--r--. After the first letter, nine letters come in three groups of three: read, write and run, for the owner, the group, and everyone else. Running chmod 600 myfile.txt gives the owner read and write and everyone else nothing. The permission note lives in the file system record, not in the file bytes, so changing it is instant.

That record, called an inode on Linux, holds two things: where the file blocks are, and who may touch them. The directory itself is only a table mapping names to those records. A hard link is simply a second name pointing at the same record, so one file can have two names.

Good to know

Copying a file reads its bytes and writes a brand new file, so the system makes a new record and finds fresh blocks. Deleting a large file is instant by contrast, since only the small record changes while the slow part, writing every block, never runs in reverse. Always run ls -l again after chmod to confirm the letters say what you wanted.

Folders map names to records, records hold block locations plus permissions, and only the record changes on delete or chmod.

2 · Watch

Take it off screen

Print a worksheetA4 with an answer key page for grown-ups. No screen, no internet.

Where it sits

Then practise

8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.

Spotted a problem on this page? Tell us
File Systems: Names, Blocks and Metadata · Computing, ages 20 to 21 · LightMySky