Linux for Developers
/Advanced
Inodes
Definition
Index Node. A data structure on a Linux file system that stores all the metadata about a file (permissions, owner, size, physical location on the disk), except for the file's actual name and data.
Explain Like I'm New
The library index card. The file's name is just a pointer to the index card. The index card (inode) tells the computer exactly which physical magnetic sectors on the hard drive contain the data.
Real World Example
You run `df -i`. It shows 100% Inode usage, even though `df -h` shows the hard drive is only 10% full. A bug created millions of tiny 1-byte files. You ran out of 'index cards' before you ran out of hard drive space. The server crashes.
Common Use Cases
- •Advanced file system debugging
- •Understanding hard links
Interview Questions
basic
- Does an inode contain the name of the file?
intermediate
- When you `mv` (rename) a file in Linux, does its inode number change?