File System Crash Consistency Flashcards
File system data structures must _______
persist
File system data structures are stored in _______ devices to survive for a long time
storage
The main challenge is to _____ persistent data structures in spite of _________ and _____ failures
update, crashes, power
In a scenario with 3 writes to data block, inode, and data bitmap with only 1 write succeeding, what happens of only the data block is written to disk?
This is as if the write did not happen because the inode was never updated -> nothing to worry about
In a scenario with 3 writes to data block, inode, and data bitmap with only 1 write succeeding, what happens if only the inode is updated?
The inode points to a new data block, but there’s no actual data there -> inode reads garbage data (inconsistency)
In a scenario with 3 writes to data block, inode, and data bitmap with only 1 write succeeding, what happens if only the bitmap is written?
Bitmap indicates data block is used, but nothing points to it -> space leak as data block will never be used (inconsistency)
In a scenario with 3 writes to data block, inode, and data bitmap with 2 writes succeeding, what happens of the inode and bitmap are written?
The data block is not updated -> following inode leads to garbage data (inconsistency)
In a scenario with 3 writes to data block, inode, and data bitmap with 2 writes succeeding, what happens when the inode and data block are written?
Allocation of data block not recorded -> data block may get re-allocated (data corruption)
In a scenario with 3 writes to data block, inode, and data bitmap with 2 writes succeeding, what happens when the bitmap and data block are written?
We have no idea which file the new allocated data block belong to
The goal of the crash consistency problem is to move the file system from one consistent state to another ________
atomically
what are 2 challenges of the crash consistency problem?
- Disk only commits one write at a time (but we need to do many)
- Crashes a power failures may happen between writes
One solution to the crash consistency problem is the file system _______
checker
The fsck is a _____ used for finding inconsistencies in file system and ____ them
tool, fix
What structures are checked by fsck?
superblock, free blocks, inode state, inode pointers, etc
fsck cannot fix all problems because a file system may look ________ but the inode points to _______
consistent, garbage
The real goal of the fsck is to make sure the file system ________ is consistent
metadata
fsck performs _______ checks on the superblock, like making sure file system size > number of _____
sanity, blocks
How does fsck check free blocks?
Scan inodes, direct, and indirect blocks to learn which blocks are allocated, then cross check with the bitmaps
If the fsck suspects the inode state is corrupted after a ______ check, it clears it as it is not an easy fix
sanity
What does fsck check for inode links and how does it do it?
fsck checks the link count. It does it by scanning the entire directory tree to build up new link counts
fsck checks for duplicates by checking if 2 different _______ point to the same ____
inodes, block
fsck checks for bad blocks by scanning through the list of _______ and checking for bad pointers i.e. pointer pointing to block number outside ______ size
pointers, partition
How does fsck check directories?
fsck does integrity checks. Make sure . and .. are first 2 entries and each inode referred to in the directory is allocated
fsck does not know about the _______ of normal files
content
fsck needs detailed _______ of the file system
detailed
fsck is an ________ tool and is typically invoked at ______
offline, boot