Definition: Organizing records within blocks on secondary storage.
Methods of Blocking:
1. Fixed-Length Blocking:
Fixed-length records used.
An integral number of records stored in a block.
Internal Fragmentation: Unused space at end of each block.
2. Variable-Length Spanned Blocking:
Variable-length records packed into blocks with no unused space.
3. Variable-Length Unspanned Blocking:
Variable-length records used but spanning isn't employed.
Fragmentation: A significant concern here.
Units of I/O: Records organized as blocks for input/output operations.
Figure 12.8: Shows different blocking methods:
Red: Fragmentation in Blocks
Track representation with various recorded examples.
Basics of File Allocation:
On secondary storage, a file is a collection of blocks.
The system manages allocation of blocks to files.
The choice of allocation strategy influences free space management.
Allocation Structure:
Space allocated to files in contiguous portions (blocks).
Management through a File Allocation Table (FAT).
Preallocation:
Requires declaration of maximum file size at creation.
Tends to be wasteful due to overestimation.
Dynamic Allocation:
Space allocated in portions as needed.
Trade-offs:
Contiguity: Increases performance (important for transactions).
Small Portitions: Result in larger tables needed for management.
Fixed Size Portions: Simplifies reallocation of space.
Variable-Size Portions: Minimize wasted storage.
Two Major Alternatives:
Variable, Large Contiguous Portions:
Better performance with less waste.
Small Fixed Portions:
Greater flexibility but may require more complex structures.
Types:
Contiguous (Necessary preallocation, Variable portion size).
Chained (Possible preallocation, Fixed blocks).
Indexed (Possible preallocation, Variable portion size).
Advantages:
Efficient for sequential file types.
Disadvantages:
Can lead to fragmentation and unusable short block sequences.
Feature: Can use any free block on disk.
Disadvantage: Files may be scattered, violating locality.
Key Point: Distinguish from indexed file types previously covered.
Indexes: Can accommodate both indexed and non-indexed files.
Importance: Managing unallocated space is crucial.
Disk Allocation Table: Needed alongside File Allocation Table.
Bit Tables: Uses a vector indicating free blocks (0 for free, 1 for in use).
Advantages: Compact and compatible with all allocation methods.
Chained Free Portions: Uses pointers to link free portions together.
Indexing: Treats free space as a pseudo-file with an index.
Free Block List: Sequential numbering of free blocks maintained.
Definition: Collections of addressable sectors in secondary memory.
Logical Disk: Presented as a separate disk to users.
Physical Layout: Need not be physically consecutive; logical continuity maintained.