by microtonal · 10y ago · 0 comments
It depends on the filesytem, but it is typically a function of filesystem size (and in ext, the number of block groups and inodes per block group size). To take an example:
sudo tune2fs -l <device> | egrep -i 'group'
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
So, we have got 1 inode per 4 blocks. This particular filesystem has 79472640 blocks (of 4KiB) and 19873792 inodes. This corresponds to the 4:1 ratio: 79472640 / 19873792 =~ 4.(The exception are empty files, because on most filesystems an empty file does not use any data blocks, but possibly an inode to store file size, permissions, etc.)