Level 0 · Module 2

File systems

Learn how a file system maps named files to storage and preserves their metadata.

Difficulty
beginner
Time
9 min read
Reading progress0% read

Not completed

By the end, you can

  • Explain the role of a file system.
  • Distinguish file content from file metadata.
  • Describe why mounting, free space, and safe removal matter.

Summary

A file system defines how an operating system names, stores, locates, and tracks files on a storage device. It manages both file content and metadata.

Introduction

Files appear as simple names and folders, but storage devices hold blocks of bytes. A file system connects these two views.

Explanation

The file system records which storage blocks belong to a file and keeps metadata such as size, timestamps, type, and access rules. It tracks free space and directory relationships. A mount point makes one file system accessible at a location in the directory tree. File-system formats differ, so their limits and features differ too.

Real-world example

Saving a photo to a USB drive

The OS asks the USB drive’s file system for free blocks, writes the photo data, and records its name and metadata. Safe removal lets pending writes finish before the device disappears.

Connect names to blocks

file-system-map.txttext
directory entry: photo.jpg
metadata: size 6 KB, owner lee
data blocks: 41 → 92 → 93
free-space map: blocks still available

Code example

save-sequence.txttext
1. find free storage blocks
2. write file content
3. update metadata and directory entry
4. confirm the operation completed

Common mistakes

  • Treating a folder name as the physical location of its bytes.
  • Assuming all file systems support identical names, permissions, or maximum sizes.
  • Removing storage while writes may still be buffered.

Quiz

Knowledge check

Which item is file metadata rather than file content?

Try it

Explain safe removal

Explain why a copied file may appear in a directory before every buffered byte has reached a removable drive.

Key takeaways

  • File systems map logical names and files to storage blocks.
  • Metadata describes files separately from their content.
  • Mounting exposes a file system; safe removal protects pending work.
View module overview