Level 0 · Module 2
File systems
Learn how a file system maps named files to storage and preserves their metadata.
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
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
directory entry: photo.jpg
metadata: size 6 KB, owner lee
data blocks: 41 → 92 → 93
free-space map: blocks still availableCode example
1. find free storage blocks
2. write file content
3. update metadata and directory entry
4. confirm the operation completedCommon 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
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.