Key Points: Filesystem Organization
Filesystem Layers
- High-Level Filesystem:
- Handles files, directories, and permissions
- Provides arbitrary-length files and byte-level access
- Built on top of low-level filesystem
- Low-Level Filesystem:
- Works with numeric file IDs
- Reads and writes logical blocks
- Manages block allocation and free space
- Block Device Layer:
- Provides block-level read/write operations
- Handles buffering and caching
- May include features like trim for SSDs
Filesystem Organization Schemes
- Fixed Partitioning:
- Divides disk into equal-sized partitions
- Simple but inflexible
- Wastes space with internal fragmentation
- Dynamic Partitioning:
- Allocates space as needed
- Blocks of a file must be contiguous
- Limited by inability to grow existing files
- File Allocation Table (FAT):
- Uses a table to track chains of blocks
- Allows noncontiguous files
- Clusters reduce fragmentation and overhead, but introduce internal fragmentation
- Indexed Allocation:
- Uses index nodes (“inodes”) to track blocks
- Supports multiple levels of indirection
- Allows sparse files
- Extents:
- Tracks ranges of contiguous blocks
- Balances flexibility and efficiency
- Used in more modern filesystems like HFS+
Free-Space Management
- Basic Approaches:
- Free space lists
- Bitmaps
- Zoned allocation
- Key Concepts:
- Internal fragmentation
- External fragmentation
- Block coalescing
- Space reservation
- Management Strategies:
- Ordered free lists for contiguous allocation
- Bitmap-based allocation for quick status checks
- Zoned allocation for reduced fragmentation
Remember
- Filesystem design involves balancing simplicity, efficiency, and flexibility
- Modern filesystems use sophisticated schemes to manage space effectively
- Different schemes have different trade-offs for various workloads
- Metadata management is crucial for filesystem reliability
- The characteristics of different storage media can't be ignored
- Free-space management affects both performance and space efficiency
(When logged in, completion status appears here.)