On a Linux ext4 file system, where is a file's name stored?
In the directory entry, not in the file's inode.
- In the file's inode
- In the directory entry ✔
- In the first block of the file
Why: An inode holds a file's metadata, like size, owner, time stamps and where its blocks are. The name lives in the directory, which maps names to inode numbers. That is how one file can have several names through hard links.
Huh, didn't know that: An ext4 directory entry stores a copy of the file type to make directory lookups faster.
Why did the inode have an identity crisis? It knew everything about the file except its name.
References
Answer: In the directory entry. An inode holds a file's metadata, like size, owner, time stamps and where its blocks are. The name lives in the directory, which maps names to inode numbers. That is how one file can have several names through hard links.
- Linux kernel docs: ext4 Index Nodes docs.kernel.org/filesystems/ext4/inodes.html
the inode stores all the metadata pertaining to the file (time stamps, block maps, extended attributes, etc), not the directory entry
Checked 2026-10-10. - OpenStax Introduction to Computer Science 6.5: File Systems openstax.org/books/introduction-computer-science/pages/6-5-file-systems
An inode contains metadata about a file or directory but not its name.
Checked 2026-10-10.
Think this answer is wrong? Tap "Challenge this answer" on the card in the game and tell us why.
More stuff everyone should know
That's stuff everyone should know.