Which allocation method suffers from external fragmentation?
File-System Implementation
On-disk and in-memory file-system structures, the allocation methods (contiguous, linked, FAT, indexed and the UNIX combined scheme), and free-space management with bit vectors, linked lists, grouping and counting.
How to read this page
Every original slide is shown unchanged. Yellow marks on a slide point to a numbered note: hover or tap a mark to jump to its note, and hover a note to see its marks. Questions tagged Past exam appeared on a real paper; Prediction questions are likely angles, not confirmed. Pick an answer to each question: a wrong pick tells you why it is wrong, so you can try again.
All 37 slides
- 1 Slide 1
- 2 Outline of this lecture
- 3 Objectives
- 4 File System Implementation
- 5 on-disk File-System Implementation
- 6 On-disk File-System Implementation (Cont.)
- 7 In-Memory File System Structures
- 8 In-Memory File System Structures
- 9 Allocation Methods
- 10 Allocation Methods - Contiguous
- 11 Example
- 12 Contiguous Allocation
- 13 Example
- 14 Allocation Methods – Linked
- 15 Linked Allocation
- 16 Linked Allocation
- 17 Linked Allocation (Cont.)
- 18 Linked Allocation
- 19 Allocation Methods – Linked (Cont.)
- 20 File-Allocation Table
- 21 Allocation Methods - Indexed
- 22 Example of Indexed Allocation
- 23 Indexed Allocation (Cont.)
- 24 Combined Scheme: UNIX UFS
- 25 Free Space Management
- 26 Free-Space Management: 1) Bit Vector
- 27 Free-Space Management: 1) Bit Vector (Cont.)
- 28 Example:
- 29 Free-Space Management: 1) Bit Vector (Cont.)
- 30 Given the following: • Block Size: 4 KB=4096 bytes • Disk Size: 1 TB=1024=1,099,511,627,776 bytes Calculation:
- 31 Free-Space Management: 2) Linked List
- 32 Free-Space Management: 2) Linked List(cont.)
- 33 Free-Space Management: 3) Grouping
- 34 Free-Space Management: 3) Grouping
- 35 Free-Space Management: 4) Counting
- 36 Free-Space Management: 4) Counting
- 37 Slide 37
Allocation Methods - Contiguous
Notes
Contiguous: each file occupies consecutive blocks (start, length). Fast sequential and direct access; external fragmentation, hard to grow.
Exam angle
Allocation Methods – Linked
Notes
Linked: each block points to the next. No external fragmentation, but direct access is slow and a lost pointer breaks the chain.
Exam angle
Linked allocation supports efficient direct access.
- You must follow the chain from the start.
File-Allocation Table
Notes
FAT: the next-block pointers live in a table at the start of the volume (cached), so direct access is faster.
Allocation Methods - Indexed
Notes
Indexed: each file has an index block of pointers. Direct access without external fragmentation; costs the index block.
Combined Scheme: UNIX UFS
Notes
UNIX inode: 12 direct pointers + single, double and triple indirect blocks.
Exam angle
4 KB blocks and 4-byte pointers. How much data can one single-indirect block address?
Compare with the model answer
4096 / 4 = 1024 pointers × 4 KB = 4 MB.
Free-Space Management: 1) Bit Vector
Notes
Bit vector: one bit per block (1 = free in the slides). Easy to find contiguous space; the map takes disk-size / block-size bits.
Exam angle
A 1 TB disk with 4 KB blocks needs a bit map of:
- 2⁴⁰/2¹² = 2²⁸ bits = 2²⁵ bytes.