A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

File System Concepts

College Depth 79 in the knowledge graph ☐ I know this ☆ Set as goal
64topics build on this
335prerequisites beneath it
See this on the map →
Basic Input and OutputFile I/O Basics→→Access Control: ACLs and Capability ListsDatabase Transactions+5 more
file metadata file-attributes file-operations file-types

Core Idea

A file is the OS abstraction for persistent named data — a sequence of bytes stored on a device that survives process termination. Every file has metadata: name, type, size, permissions, timestamps, and a unique identifier. The file system is the OS subsystem responsible for organizing files into a hierarchical namespace, tracking their locations on storage devices, managing free space, and enforcing access control. The OS provides a uniform file interface (open, read, write, seek, close) that abstracts over the physical storage device, whether it is a hard disk, SSD, or network share.

How It's Best Learned

Use stat() in Python or C to inspect a file's full metadata. Then read the ext4 or NTFS Wikipedia article to see how these abstractions are implemented.

Common Misconceptions

Explainer

At its heart, a file system answers a deceptively simple question: how do you store named data on a device that only understands numbered blocks? A hard disk or SSD is just a flat array of fixed-size blocks (typically 512 bytes or 4 KB). The file system builds the abstractions of files, directories, names, and permissions on top of this raw storage — much like how an operating system builds the abstraction of processes on top of raw CPU time. If you have worked with basic I/O, you have used the result of this abstraction every time you called `open()`, `read()`, or `write()`.

A file is the fundamental unit: a named, persistent sequence of bytes. But a file is more than its data. The OS stores metadata alongside each file — the owner, permissions, timestamps (created, modified, accessed), size, and the physical locations of its data blocks on disk. This metadata is typically stored in a structure called an inode (on Unix-like systems) or a Master File Table entry (on NTFS). The key insight is that the file's name is *not* part of the inode. The name lives in a directory entry, which is simply a mapping from a human-readable name to an inode number. This separation is why hard links work: two different names in two different directories can point to the same inode, and therefore the same data. The file exists as long as at least one name points to it.

The file system interface that the OS exposes to programs is deliberately uniform. Whether the underlying storage is a magnetic disk, an SSD, a USB drive, or a network share, you use the same operations: open (get a file descriptor), read (copy bytes from the file into memory), write (copy bytes from memory to the file), seek (move the read/write position), and close (release the file descriptor). This abstraction is powerful because application code does not need to know or care about the physical storage technology. The OS translates these logical operations into the appropriate device-specific commands — sequential reads on a hard disk, page-level writes on an SSD, or network packets for a remote file system.

Directories provide the organizational structure. A directory is itself a special file whose contents are a list of (name, inode number) pairs. Directories can contain other directories, creating the familiar hierarchical tree structure — `/home/user/documents/report.txt` is a path through four directories to reach a file. This hierarchy is a namespace: it allows millions of files to coexist with human-readable, organized names. The file system must also manage free space — tracking which blocks on the device are available for new data — and enforce access control — ensuring that only authorized users can read, write, or execute a file. These concerns are what separate a file system from a simple key-value store, and they become central when you study file system implementation next.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Conditional Statements → Defining and Calling Functions → Functions: Decomposing Problems → Function Parameters and Argument Passing → Return Values → Error Handling and Exceptions → File I/O Basics → File System Concepts

Longest path: 80 steps · 335 total prerequisite topics

Prerequisites (2)

Leads To (7)