File Systems
Secondary storage management Disk space management Free space management Disk is divided into blocks or sectors.
Disk space management When to allocate space? Portion size Pre-allocation vs. dynamic allocation. Portion size Large variable-sized portions consisting of contiguous blocks Placement algorithms – Best fit, First fit and Next fit Small fixed portions (non-contiguous blocks)
Disk space management File allocation methods Keep track of which sectors/blocks on the disk belong to which logical file/directory.
Contiguous File Allocation What happens if file F requires 6 blocks?
Contiguous allocation
File allocation method - Chained allocation/Linked list
Chained allocation/Linked list
Chained allocation after consolidation
Linked list allocation with an index File A occupies a total of _______ blocks and they are ________________. File B occupies a total of _____ blocks and they are __________________.
Linked list allocation with index A table is maintained in memory which acts as the linked list. Don’t have to access the disk to get the next pointer More efficient with random access files. Used in MS-DOS
Indexed allocation
Free space management Disk allocation table to keep track of all the used and unused blocks on the disk.