
In Operating Systems (OS), file management is an important exam topic. Allocation methods decide how file data is stored on disk blocks. Questions on allocation methods are frequent in ECET.
📘 Concept Notes
📂 What is File Allocation?
- Disk space is divided into fixed-size blocks.
- File allocation methods determine how these blocks are assigned to files.
- Goals: efficient storage utilization, fast access, and minimum fragmentation.
⚙️ Types of File Allocation Methods
1️⃣ Contiguous Allocation
- Files occupy consecutive disk blocks.
- Simple and fast for sequential & direct access.
- Problem: external fragmentation and difficulty in file growth.
Formula – Access Time (Contiguous):
Where:
= Seek time
= Rotational latency
= Transfer time
Example: File of size 3 blocks stored from block 100 → occupies 100,101,102.
2️⃣ Linked Allocation
- Each file is a linked list of disk blocks.
- Directory stores pointer to first block; each block points to the next.
- No external fragmentation.
- Disadvantage: random access is slow.
Formula – Access Time (Linked):
Where = number of blocks to be traversed.
Example: File of 3 blocks → stored in 5, 17, 9 (linked via pointers).
3️⃣ Indexed Allocation
- Each file has an index block containing pointers to all its disk blocks.
- Supports direct access.
- No external fragmentation.
- Overhead: needs one extra index block.
Formula – Storage Overhead (Indexed):
Example: File requires 4 blocks → index block points to 40, 62, 75, 90.
🔄 Comparison Table
Feature | Contiguous | Linked | Indexed |
---|---|---|---|
Access | Fast (direct) | Sequential only | Direct + Sequential |
Fragmentation | External | None | None |
File growth | Difficult | Easy | Easy |
Storage overhead | Low | Pointer per block | Index block |
🔟 10 Expected MCQs – ECET 2026
Q1. In contiguous allocation, files are stored:
A) Sequentially in random blocks
B) In consecutive disk blocks
C) In linked scattered blocks
D) Using index blocks
Q2. Main problem in contiguous allocation is:
A) Internal fragmentation
B) External fragmentation
C) Pointer overhead
D) Slow access
Q3. Which allocation supports both sequential and direct access efficiently?
A) Contiguous
B) Linked
C) Indexed
D) None
Q4. In linked allocation, each block contains:
A) File data only
B) Pointer to next block + data
C) Index of all blocks
D) Metadata
Q5. Random access is inefficient in:
A) Contiguous allocation
B) Linked allocation
C) Indexed allocation
D) None
Q6. Indexed allocation requires:
A) Pointer in every block
B) An extra index block
C) Contiguous free space
D) None
Q7. If a file of 600 KB is stored with block size , then number of blocks required = ?
A) 5
B) 6
C) 7
D) 8
Q8. Formula for access time in contiguous allocation is:
A)
B)
C)
D) None
Q9. Which allocation has external fragmentation?
A) Linked
B) Indexed
C) Contiguous
D) None
Q10. The allocation method suitable for direct access large files is:
A) Linked
B) Indexed
C) Contiguous
D) None
✅ Answer Key
Q.No | Answer |
---|---|
Q1 | B |
Q2 | B |
Q3 | C |
Q4 | B |
Q5 | B |
Q6 | B |
Q7 | B |
Q8 | C |
Q9 | C |
Q10 | B |
🧠 Explanations
- Q1 → B: Contiguous = consecutive disk blocks.
- Q2 → B: Major drawback = external fragmentation.
- Q3 → C: Indexed allows both direct and sequential.
- Q4 → B: Linked allocation stores pointer + data.
- Q5 → B: Linked requires traversal, so slow random access.
- Q6 → B: Needs one index block.
- Q7 → B:
blocks.
- Q8 → C: Standard formula includes seek, rotation, transfer.
- Q9 → C: Contiguous suffers external fragmentation.
- Q10 → B: Indexed is best for direct access large files.
🎯 Why Practice Matters
- File allocation methods are repeated exam topics.
- Questions test both theory (features) and numerical formulas (access time, block calculation).
- Easy 2–3 marks if concepts are clear.