---
title: "File system vs virtual memory; contiguous allocation"
subject: "Operating System"
chapter: 5
key: "semester_6/operating_system:fs-vs-virtual-memory-contiguous-tape"
source: https://www.bctengineer.com/q/semester_6/operating_system/fs-vs-virtual-memory-contiguous-tape
site: BCT Engineering
---

# File system vs virtual memory; contiguous allocation

Operating System · Chapter 5: File Systems

- Asked in: 2073 Bhadra, 3+3 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/operating_system/fs-vs-virtual-memory-contiguous-tape
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-5

## Question

In what ways is file system management similar to virtual memory management? What are the advantages and disadvantages of a contiguous file allocation scheme? Which file organization technique is most appropriate for tape storage? Why?

## Short answer

Both provide a logical view mapped to physical blocks, use fixed-size units, free-space tracking, multi-level indexing, caching, and suffer fragmentation. Contiguous allocation gives fast sequential access and simple directory but causes external fragmentation and needs pre‑declared size. Tape best suits contiguous organization because sequential access avoids seek delays inherent in linked or indexed methods.

## Answer

#### File system management versus virtual memory management
They are similar in the following ways:
- Both give a **logical view** (file/virtual address) independent of physical location, with a mapping (directory/i-node or page table) to physical blocks/frames.
- Both use fixed-size units (disk blocks / pages and frames) and have allocation methods and **free-space lists** (bitmap, free list).
- Both use **indexed/multi-level structures** (i-node indirect blocks and multi-level page tables).
- Both use **caching** (buffer cache / TLB and page cache) and suffer **fragmentation** (internal in the last block/page).
- Both support **sharing and protection** and use secondary storage (disk) with a replacement policy for the cache.

#### Contiguous allocation scheme
Each file occupies consecutive disk blocks.
- **Advantages:** simple; the directory stores only the start block and length; excellent read performance (one seek for the whole file) for both sequential and direct access.
- **Disadvantages:** external fragmentation (requires compaction); the file size must be known when created; hard to grow; wasted space if reserved size is large.

#### File organization best for tape
**Sequential (contiguous) organization** is most suitable for tape. A tape is a sequential-access device: it can only be read from the start in order, and moving to a given block requires winding the tape. Contiguous storage lets records be read and written in order at full tape speed with no seeking or pointer chasing; linked and indexed methods rely on random access and would be extremely slow.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which is a similarity between file system management and virtual memory management?
   A. Both give a logical view independent of physical location through a mapping structure
   B. Both require contiguous physical allocation
   C. Both use only a single-level table
   D. Both avoid fragmentation completely
   Answer: A. Files map to disk blocks through directory/i-node; virtual addresses map to frames via page tables. (Key point: Similarity of mapping)

2. What is a key advantage of contiguous file allocation?
   A. Files can grow easily without moving
   B. Excellent read performance, as a whole file needs only one seek
   C. There is no external fragmentation
   D. File size need not be known at creation
   Answer: B. Consecutive blocks mean one seek for the whole file, and the directory stores only start block and length. (Key point: Contiguous advantage)

3. Which is a disadvantage of contiguous allocation?
   A. Pointer overhead in every block
   B. Slow sequential access
   C. External fragmentation, needing compaction, and difficulty growing a file
   D. Large in-memory table for the whole disk
   Answer: C. Contiguous files leave scattered holes (external fragmentation) and are hard to extend. (Key point: Contiguous disadvantage)

4. Why is sequential (contiguous) organization best for tape?
   A. Tape supports fast random access to any block
   B. Tape needs index blocks for every record
   C. Linked allocation is fastest on tape
   D. Tape can only be read in order, so contiguous records avoid seeking and pointer chasing
   Answer: D. Tape is a sequential-access device; winding to a block is slow, so linked or indexed methods are very slow on it. (Key point: Tape organization)

## Related in Operating System

- [File allocation methods; free space management](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afile-allocation-free-space-methods) — Operating System, chapter 5, asked 2×
- [Virtual memory management; thrashing](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Avirtual-memory-thrashing) — Operating System, chapter 4
- [File system layout; free block management](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afs-layout-free-blocks) — Operating System, chapter 5
- [File attributes; FS implementation ways](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afile-attribute-implementation-best) — Operating System, chapter 5
- [File and attributes; allocation methods](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afile-attributes-allocation-methods) — Operating System, chapter 5
- [File allocation and access methods](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afile-allocation-access-methods) — Operating System, chapter 5

## Related in other subjects

- [Organization vs management; scientific approach](https://www.bctengineer.com/question.md?key=semester_7%2Forganization_and_management%3Aorg-vs-management-scientific) — Organization and Management, chapter 2
- [Dynamic memory allocation with new and delete](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Adynamic-memory-allocation) — Object Oriented Programming, chapter 3, asked 2×
- [8051 data memory organization](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3A8051-data-memory-organization) — Embedded System, chapter 9
- [Protection requirements; protective system vs scheme](https://www.bctengineer.com/question.md?key=semester_6%2Fswitchgear_and_protection%3Aprotective-system-vs-scheme) — Switchgear and Protection, chapter 1
