what’s read-modify-write?
read in a sector, modify the byte, write it back
tradeoff of a sector?
+ sector writes are always completed
- larger atomic units have to be created by the OS
what’s location transparency?
the ability to access data w/o knowing its location
FS working intuitions
FS performance dominated by # of FS accesses
transfer time is negligible compared to seek time + rotational delay
tradeoffs of contiguous allocation
+ simple, fast access, sequential and random
- external fragmentation
tradeoffs of linked files
+ easy dynamic growth, sequential access, no fragmentation
- non-contiguous blocks = bad access times
- bad random access
- pointers take up space
FAT benefits
cache entire FAT, cheap compared to disk access when pointer chasing
space overhead trivial
must duplicate to protect against errors
indexed files tradeoffs
+ sequential, random easy
- mapping table requires large chunk of contiguous space
multilevel indexed files
+ solves space issues of indexed files
+ small files are fast, large max file size
- worst case 3 FS accesses (di -> i -> b)
- 13 block file = big space overhead
- metadata and data are strewn across disk
what are hard links?
a refcount of pointers to an inode
what are soft links?
like a directory: inode has special symlink bit set, file contents are name of target
what does the superblock store?
block size, # of blocks, max # of files, pointer to head of free list/bitmap, information necessary to locate an inode given its inumber
issues with old file system?
how FFS fixes block size?
4KiB min, increases bandwidth
eliminate internal fragmentation with fragments
how FFS fixes clustering?
cylinder groups
- data blocks of a file in same CG
- inode and data in same CG
- inodes of a directory in same CG
how FFS bitmap improves free list?
easier to find contiguous blocks
smaller, keep entire bitmap in RAM
tradeoff of the FFS bitmap?
time to find a free block increases with fewer free blocks
how FFS deals with bitmap tradeoff?
trade space, always keep about 10% of disk free, scattered across disk
only root can allocate blocks once 100% full
how can FS summary info be wrong?
corrupt inodes
fields in inodes are wrong
directories are bad
corrupt inodes
not a simple crash
- bad block numbers, block used in more than one place
fields in inodes wrong
count # of directory entries to verify link count, if no entries but count /= 0, move to lost and found
make sure size and used data counts match blocks
directories may be bad
. and .. must be valid, file names must be unique
all directories must be reachable
ordered updates
don’t point to garbage
- never write ptr before initializing struct it points to
- never reuse resource before nullifying all ptrs to it
- never clear last ptr to live resource before setting new one
block aging
block that always has dependency will never get written back