Course contentsShow
← Linux
Lesson 274 of 1,8193. The Filesystem Hierarchy and POSIX StandardsFree lesson

Interpreting Filesystem Meta-information

Determine how the system organizes disk space using fixed logical structures.

In this lesson, you will learn how the Linux filesystem organizes disk space into fixed logical structures to track your files without storing the actual data in a chaotic heap.

The Logical Structure of the Disk

When you save a file, the operating system doesn’t just toss bytes onto a spinning platter or flash chip. Instead, it divides storage into fixed logical units called blocks. To keep track of these blocks, the filesystem uses a data structure known as an inode (index node).

Think of an inode as the "identity card" for a file. Every file has exactly one inode, which contains the file’s meta-information: its size, permissions, owner, timestamps, and—crucially—a map of which physical blocks on the disk hold the actual contents. The filename you see in your directory is merely a label pointing to this inode.

Inspecting Meta-information

You can observe this metadata structure firsthand using the stat command. Unlike ls, which gives you a brief summary, stat peels back the layer to show you the underlying logical information of a file.

Try running this in your terminal:

stat /etc/passwd

You will see output similar to this:

  • File: The name of the file.
  • Size: The total byte count.
  • Blocks: The number of 512-byte blocks allocated for the file.
  • IO Block: The filesystem's preferred block size for read/write operations.
  • Inode: The unique identifier for this file within the filesystem partition.

Fixed Logical Units

The system organizes space by dividing the disk into these rigid segments. When a process requests a file, the kernel doesn't search for "my_document.txt"; it looks up the filename in the directory structure to find the inode number. It then uses the block map within that inode to jump directly to the specific disk sectors containing the data. By relying on these fixed logical structures, the system ensures that disk access remains efficient, consistent, and independent of where the file was originally created.

Key Takeaway: The filesystem organizes disk space using fixed logical blocks linked by inodes, which act as the authoritative metadata map for every file on your system.