File Systems

A file system organises data into files and directories, using inodes (or a FAT) to track metadata and the blocks a file occupies, and free-space structures plus journaling to allocate space efficiently and survive crashes.

Key formulas & points

Skim these first — then read the full notes below.

  • FAT versus inode-based allocation (ext4, NTFS)
  • Journaling logs metadata changes for crash recovery
  • Access methods: sequential, direct, indexed

Topic details

Introduction

This Galvin topic covers on-disk organisation. You compare allocation schemes (contiguous, linked, indexed/inode), understand how directories map names to files, analyse free-space management, and see how journaling protects metadata consistency across failures.

Key relations & formulas

Formulas (Indian textbook notation)

  • inodestoresmetadata;datablocksholdfilecontentinode stores metadata; data blocks hold file content

Formulas (Indian textbook notation)

  • directoryentrymapsanametoaninodenumberdirectory entry maps a name to an inode number

Formulas (Indian textbook notation)

  • freespacetrackingviaabitmaporalinkedlistfree-space tracking via a bitmap or a linked list

Notation and sign conventions

Relation 1 —
inodestoresmetadata;datablocksholdfilecontentinode stores metadata; data blocks hold file content

Formulas (Indian textbook notation)

  • inodestoresmetadata;datablocksholdfilecontentinode stores metadata; data blocks hold file content
Write this relation with symbols exactly as in Operating System Concepts — Silberschatz, Galvin & Gagne before substituting numbers. Examiners award partial marks for a correct setup even when arithmetic slips.
Relation 2 —
directoryentrymapsanametoaninodenumberdirectory entry maps a name to an inode number

Formulas (Indian textbook notation)

  • directoryentrymapsanametoaninodenumberdirectory entry maps a name to an inode number
Write this relation with symbols exactly as in Operating System Concepts — Silberschatz, Galvin & Gagne before substituting numbers. Examiners award partial marks for a correct setup even when arithmetic slips.
Relation 3 —
freespacetrackingviaabitmaporalinkedlistfree-space tracking via a bitmap or a linked list

Formulas (Indian textbook notation)

  • freespacetrackingviaabitmaporalinkedlistfree-space tracking via a bitmap or a linked list
Write this relation with symbols exactly as in Operating System Concepts — Silberschatz, Galvin & Gagne before substituting numbers. Examiners award partial marks for a correct setup even when arithmetic slips.

Concept in depth

A file system must answer two questions efficiently: where are a file’s blocks, and which blocks are free. Contiguous allocation gives fast sequential access but suffers external fragmentation; linked allocation avoids fragmentation but is poor for random access; indexed/inode allocation stores block pointers in a per-file structure, balancing both and enabling direct access. Directories are themselves files that map human-readable names to inode numbers, decoupling naming from storage. Because a crash mid-update can corrupt metadata, journaling first writes intended changes to a log so recovery can replay or discard them, keeping the file system consistent.

Assumptions and validity limits

State assumptions explicitly before using any relation for file systems — steady state, uniform properties, linear elastic material, ideal gas, incompressible flow, etc., as applicable.
Wrong assumptions invalidate the entire solution even when the formula is correct. In Operating Systems viva and GATE descriptive questions, listing valid assumptions often earns separate marks.

Step-by-step problem approach

1. Read the question and list given data with SI units (common in Operating Systems papers).
2. Draw a neat labelled diagram where applicable — examiners in Indian universities award diagram marks even when arithmetic slips.
3. Identify which relation from this topic applies to file systems.
4. Use equation 1:
inodestoresmetadata;datablocksholdfilecontentinode stores metadata; data blocks hold file content
.
5. Use equation 2:
directoryentrymapsanametoaninodenumberdirectory entry maps a name to an inode number
.
6. Substitute values, compute, and verify units and sign (direction).
7. State conclusion in one line — e.g. safe/unsafe, stable/unstable, feasible/infeasible.

Applications & exam relevance

File Systems appears in systems software and backend. In Indian it software curricula this topic is tested because it connects theory to process, memory, and file management.
GATE and semester exams often combine file systems with earlier units — revise prerequisites before attempting mixed problems.
Industry interview panels sometimes ask: "Where did you use file systems?" — answer with a lab, mini-project, or plant visit example if possible.

Common mistakes in exams

Students confuse the inode (metadata and block pointers) with the directory entry (name-to-inode mapping), and think journaling always logs file data (usually just metadata by default). Mixing up the trade-offs of contiguous, linked and indexed allocation is common.

Quick revision checklist

Before attempting file systems problems, confirm you can:
1. FAT versus inode-based allocation (ext4, NTFS)
2. Journaling logs metadata changes for crash recovery
3. Access methods: sequential, direct, indexed
Revise the solved examples in Operating System Concepts — Silberschatz, Galvin & Gagne and one previous-year GATE or university paper for this unit.

Worked examples

Try the problem first — open the solution when you are ready to check.

Allocation scheme choice

Problem

A workload needs fast random access to large files that grow unpredictably. Which allocation scheme fits best and why?

Solution

Indexed (inode-based) allocation: its block-pointer index supports direct random access and lets files grow by adding blocks, unlike contiguous (fragmentation, fixed size) or linked (slow random access).

Conceptual check — File Systems

Problem

In a Operating Systems semester or GATE paper you are asked: "State the main assumption, the governing relation, and one practical consequence of file systems." What should a complete answer include?

📖 Standard books (India)

  • Operating System ConceptsSilberschatz, Galvin & Gagne

    Read: Syllabus unit

    Processes, memory, and file systems