Files and IO Flashcards
All files stored in root directory
Single level directory
Files stored in tree structure
Hierarchial directory
Direct copy of a file to another place in directory tree
Hard link
Sector 0 stores this
Master Boot Record
Stores start and end of each partition. Used to boot
Master Boot Record
Each file stored as continuous run of blocks
Contiguous allocation
Benefits from fast read times and easier to track blocks
Contiguous allocation
Leads to disk fragmentation and can be expensive to compact
Contiguous allocation
Each block stores pointer to next block in file, not necessarily same physical block
Linked list allocation
No external fragmentation, but slow random access
Linked list allocation
Store linked list as array, with index as physical block and value is next file block. Value of -1 is the last block
Linked list allocation using In-Memory table
Each directory entry only needs to store starting block number for file
Linked list allocation using In-Memory table
Entire table must be in memory at same time for faster access than LL
Linked list allocation using In-Memory table
Store attributes and disk addresses of file blocks
I-nodes
Only needs to be in-memory when file accesses
I-nodes
Dependent on number of files open at once
I-nodes
Each directory entry points to fixed portion, with length of entry and data
Directory implementation
I-node stores file length, attributes and file name in memory
Directory implementation with contiguous memory
I-nodes stores file names in a heap, pointed to by file entry
Directory implementation with heap
Used to guard against lost files during crashes
Journaling file system
Keep a list of actions before taking them, then perform actions
Journaling file system
Operations should be ________ to ensure that actions can be replayed without harm
idempotent
a measure of state change
idempotent
Each file has many blocks, leading to more seeks and rotation delay
Smaller blocks in disk