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
Waster space within blocks, but better transfering
Larger blocks in disk
Start at block 0 of disk. Write every block to output disk and stop during last block.
Physical dump
Also copies bad blocks, which can cause corruption
physical dump
Cannot restore individual files
physical dump
Start at specific directory and recursively dump all files and directories since last modified
logical dump
Easier to restore specific file
logical dump
Start at root, mark bit for modified files and all directories
logical dump - phase 1
walk tree, unmark directories without any modified files
logical dump - phase 2
go through i-nodes and dump marked directories
logical dump - phase 3
Stores collection of blocks that are kept in memory for frequent access
caching
Some blocks may not actually be referenced twice within a short interval (anti-temporality)
issue with caching
Blocks likely not needed again are placed at front of queue, and blocks needed again are at back of queue
caching, addressing temporality