File Allocation Methods
The allocation method decides how a file’s blocks are placed on disk. Good placement makes files quick to read while leaving enough flexibility for growth and deletion.
Selected method
Contiguous
Data blocks
5 blocks
Main trade-off
External fragmentation
Contiguous allocation
Stores all blocks together. It offers fast sequential and direct access, but a growing file may need a new run and free space can become fragmented.
Linked allocation
Places blocks anywhere and stores a pointer in each block. There is no external fragmentation, but following a chain makes direct access slower.
Indexed allocation
Keeps all data-block addresses in an index block. It supports direct access and scattered blocks, with extra space needed for the index.
Real-world analogy: Finding seats
| Method | Direct access | Growth | Main weakness |
|---|---|---|---|
| Contiguous | Excellent | Difficult | External fragmentation |
| Linked | Slow | Easy | Pointer overhead |
| Indexed | Good | Easy | Index-block overhead |
1. Which method stores file blocks in one consecutive run?
2. What does a linked-allocation block usually contain besides data?