Skip to main content

File system layout; i-node vs linked list

Short answer

Disk layout: MBR, partition table, boot block, superblock, free-space bitmap, i-node array, root directory, data area. I-node uses index block for fast random access and reliability; linked list chains blocks with pointers, slow random, pointer overhead, less reliable.

What is file system layout? Compare I-Node with linked list.

File system layout

A file system layout is the way the disk is organised to store the file system. A disk is divided into partitions; each partition holds an independent file system.

 Sector 0                      whole disk
 +-----+-----------+-------------+-------------+
 | MBR | Partition | Partition 1 | Partition 2 |
 |     |   table   |             |   ...       |
 +-----+-----------+-------------+-------------+

 One partition:
 +------+-------+----------+---------+------+----------------+
 | Boot | Super | Free-    | I-nodes | Root | Files and      |
 | block| block | space    |         | dir  | directories    |
 |      |       | mgmt     |         |      |                |
 +------+-------+----------+---------+------+----------------+
  • MBR (Master Boot Record): sector 0; contains boot code and the partition table with start and end of each partition and the active one. The BIOS reads and runs it, which loads the boot block of the active partition.
  • Boot block: first block of a partition; program that loads the operating system.
  • Superblock: key information about the file system: type (magic number), number of blocks, block size, number of i-nodes, free-block counts.
  • Free space management: bit map or list of free blocks.
  • I-nodes: an array of i-nodes, one per file (attributes and block addresses).
  • Root directory: top of the directory tree.
  • Data area: all the other files and directories.

I-node versus linked-list allocation

An i-node holds a list of the file's block addresses in one place (an index); linked-list allocation chains the blocks with pointers stored in each block.

PointI-node (indexed)Linked list
Location of block addressesIn the i-node (index block)In each data block (pointer to next)
Random accessFast (find address in index directly)Slow (follow chain from start)
Block data sizeFull block holds dataPointer reduces usable data size
Memory useOnly i-nodes of open files in memoryNothing (but traversing needs disk reads)
ReliabilityPointers are in one place; protectedOne damaged pointer loses rest of the file
Large filesNeeds indirect blocksNo limit, simple
Overhead for small filesWhole i-node usedVery little
Sequential accessGoodGood

Therefore i-nodes support both sequential and direct access efficiently and are used in UNIX/Linux file systems, whereas pure linked lists suit only sequential access.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 5 questions →