File System Flashcards
Data is stored on
Physical devices, eg disks
A file is a
Logical view of the data , perceived by the programmer
A file system creates
An interface between users and files
A file allocation method
Refers to how disk blocks are allocated & organized for files on the disk
Contiguous allocation
Each file occupies set of contiguous blocks
Pros of contiguous allocation
Best performance in most cases
Simple- only starting location (block #) and length (number of blocks) are required
Cons of contiguous allocation
Finding space for file
estimating a file size at creation, or growing it
External fragmentation
Compaction
Linked Allocation
Each file is a linked list of disk blocks: blocks may be scattered anywhere on the disk
Pros of linked allocation
Simple, only need starting address
Free-space management system- no waste of space
Defragmentation not necessary for file allocation
Cons of linked allocations
No random access, locating a block can take many disk seek & I/O
Extra space required for pointers
Clusters
Reliability: What if a pointers gets corrupted
File Allocation Table
Beginning of volume has table indexed by block number
Indexed Allocation
Brings all pointers together into the index block, to allow random access to file blocks
Pros of indexed allocation
Supports direct access
Prevents external fragmentation
Cons of indexed allocation
High pointer overhead -> wasted space
What is wrong with too big of index block
Waste of space for small files
What is wrong with too small of index block
Size of file will be limited
What type of file access type to use contiguous?
Great for sequential and random