File System Internals Workshop
Retrieval Prompts
- State from memory the three layers reached by
open: per-process FD table, system-wide open-file table, in-memory inode table. What is in each? - What is an inode, and what does it not contain?
- How does a directory resolve
foo.txtto an inode number? - Sketch the ext-style on-disk layout (superblock, bitmaps, inode table, data blocks) from memory.
- Explain why
forkshares an open-file entry but twoopencalls do not.
Compare and Distinguish
Separate these pairs clearly:
- file name vs inode vs file descriptor
- directory vs regular file at the on-disk level
- hard link vs symbolic link
dup(fd)vsopen(path)twice- FAT vs ext-style vs log-structured
Common Mistake Check
Identify the error in each statement:
- "
rm foodeletes the data immediately." - "
mv a bin the same directory moves the file's inode." - "
cp a bduplicates the inode." - "An ext4 file with a single extent still requires an indirect block for 1 MiB of data."
- "When two processes open the same file independently, writes through one move the read offset of the other."
- "
close(fd)releases the inode unconditionally." - "A directory's data blocks are only used for quick lookups and can be rebuilt from the inode."