When I run the df
command I'm getting different values for capacity
and %iused
. What is the difference between them?
What is the difference between 'Capacity' and '%iused' when running the 'df' command in the terminal
1 Answer
The first Used/Available/Capacity is the obvious "How much of my 1 TB drive is full?" measure. The second tracks internal storage structure called an inode or index node.
On traditional UNIX filesystems, there were a fixed number of inodes which are used to track files and directory entries (metadata and filesystem implementation data). When you ran out of inodes, you couldn't use the filesystem whether it was full or not. The df tool needed to report both resources that could fill so you could plan and maintain the filesystems.
OS X uses HFS+ which will make more inodes from any free space and can't run out of them, but they are still reported since as inode use grows, the storage is slightly less efficient and can be slower than if the filesystem were still in the original allocation of inodes.
Basically, you can just focus on Capacity/Used/Available and ignore inodes unless you are deep in filesystem implementation details.
-
1Note that APFS is slightly different, since several slices can be in a single partition. In that case, the capacity column can be misleading.– WGroleauCommented Nov 16, 2020 at 23:59
-
Fair points @WGroleau hopefully calling out of HFS+ let’s people know this is pretty old and may not translate to the new.– bmike ♦Commented Nov 17, 2020 at 0:15
-
For an example of this: apple.stackexchange.com/questions/352693/…– WGroleauCommented Nov 17, 2020 at 16:13