Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Linux is not contradicting itself: a filename, an inode, and the space reported by disk tools describe different things. A directory entry connects a name to an inode; the inode holds metadata; and filesystem space can be limited by either data blocks or available inodes. Use df -h to inspect space and df -i to inspect inode availability.

What is an inode?

An inode is a filesystem object that holds metadata associated with a file. The Linux inode manual lists information such as the inode number, file type and mode, link count, owner and group, size, allocated blocks, and timestamps. Programs can obtain this metadata through interfaces such as stat and statx.

The inode is not the filename. In ext4, a directory entry maps a name to an inode number. The kernel’s ext4 directory documentation describes a directory as mapping a byte string—usually a name—to an inode number. Think of the directory entry as a labeled card pointing to the metadata-bearing object.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why can two names refer to the same file?

A hard link is another directory entry that points to the same inode. The inode’s link count records how many hard links refer to it. As the kernel documentation puts it: “There can be many directory entries across the filesystem that reference the same inode number–these are known as hard links, and that is why hard links cannot reference files on other filesystems.”

Inode numbers are unique only within a filesystem, not across the whole Linux system. A number by itself therefore does not identify a file globally. Hard links cannot cross filesystem boundaries because the inode reference is local to its filesystem.

Why do disk-space and inode reports differ?

Filesystems track data blocks and inodes separately. Blocks account for allocated file data; inodes are the metadata-bearing objects needed for files and directories. A filesystem can have free data blocks but no free inodes, or have available inodes while its data blocks are full. These are different capacity limits, so one report cannot substitute for the other.

Question Command What it reports
How much filesystem space is used or available? df -h Filesystem space in human-readable units.
How many inodes are used or available? df -i Inode information for mounted filesystems, rather than block usage.

GNU df documentation defines -i (or --inodes) as displaying inode information instead of block usage. Formatting and option support can vary in other implementations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How can you check an inode?

  1. Inspect a path’s metadata with stat path. Its output can include the inode number, permissions and file type, link count, owner, size, allocated blocks, and timestamps.

  2. Check block capacity with df -h, or inode capacity with df -i. The filesystem containing the path is shown in the corresponding output.

  3. Interpret the results separately: a high inode usage reading concerns the supply of inodes, while full block usage concerns space for stored data.

df -i reports inode use at the filesystem level; it does not identify which directory contains the files using those inodes. Also, ext4’s documented on-disk structures are specific to ext4: the kernel’s ext4 inode documentation should not be read as a claim that every Linux filesystem uses the same layout.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.