Appearance
26. Inodes
An inode stores all metadata about a file except its name and actual data — the filename lives in a directory entry; the inode is the bridge to the data blocks.
Contents: file type, size, owner (UID/GID), permissions, timestamps (atime, mtime, ctime), link count, pointers to data blocks. Not the filename.
Referencing data blocks: 12 direct pointers (straight to data blocks) + 1 single indirect (points to a block of pointers) + 1 double indirect + 1 triple indirect — this scheme lets small files stay fast while still supporting huge files.
Finding a file (/home/user/resume.pdf): start at the root inode (always inode #2) → read root dir → find "home" → its inode → read that dir → find "user" → its inode → read that dir → find "resume.pdf" → its inode → read the data block pointers → read the actual content.
Interview facts: inodes are fixed in number at format time — you can run out of inodes before running out of disk space if you have millions of tiny files. ls -i shows inode numbers; stat file shows full inode info; df -i shows inode usage.