Skip to main content

File system layout; interface vs implementation

Short answer

File system layout: MBR, partition with boot block, superblock, free-space mgmt, i-nodes, root dir, data area. Interface defines user view (naming, operations, directory structure); implementation handles disk allocation, caching, i-nodes. Interface is stable via syscalls, implementation hidden.

Explain file system layout in detail. What are the major differences between file system interfaces and file system implementation?

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.

File system interface versus implementation

PointFile system interfaceFile system implementation
ConcernHow users and programs see and use filesHow files are stored and managed on the disk
ViewpointUser's / programmer's viewDesigner's / OS view
TopicsFile naming, attributes, types, operations (open, read, write), access methods, directory structure, protectionDisk layout, allocation methods, free-space management, directory implementation, caching, i-nodes, performance, recovery
Question answeredWhat does the file system look like?How does the file system work?
Exampleopen("a.txt"), path names, chmodContiguous/linked/indexed allocation, bitmap, FAT
Interface toApplication programs through system callsHardware (disk) via device drivers
ChangesStable, standardised (POSIX)Can change without affecting user programs

The interface hides the implementation, so the same programs run on FAT, NTFS or ext4.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 5 questions →