- 2070 Bhadra · 6+4 marks
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
| Point | File system interface | File system implementation |
|---|---|---|
| Concern | How users and programs see and use files | How files are stored and managed on the disk |
| Viewpoint | User's / programmer's view | Designer's / OS view |
| Topics | File naming, attributes, types, operations (open, read, write), access methods, directory structure, protection | Disk layout, allocation methods, free-space management, directory implementation, caching, i-nodes, performance, recovery |
| Question answered | What does the file system look like? | How does the file system work? |
| Example | open("a.txt"), path names, chmod | Contiguous/linked/indexed allocation, bitmap, FAT |
| Interface to | Application programs through system calls | Hardware (disk) via device drivers |
| Changes | Stable, 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)
Related questions
- File system layout; i-node vs linked list · Operating System, chapter 5
- File system layout, i-node, backup · Operating System, chapter 5
- File system layout; free block management · Operating System, chapter 5
- File attributes; FS implementation ways · Operating System, chapter 5
- File system layers; linked list vs index · Operating System, chapter 5
- File system vs virtual memory; contiguous allocation · Operating System, chapter 5
- Interface vs implementation · Object Oriented Analysis and Design, chapter 4 · asked 2×
- Structural model vs implementation model · Object Oriented Analysis and Design, chapter 1
- Short note: Distributed system implementation · Object Oriented Analysis and Design, chapter 4
- System implementation and conversion · Information System, chapter 6