2 ms·
How is that number calculated? It's less than 2^25 but greater than 2^24 It depends on the filesytem, but it is typically a function of filesystem size (and in
by danieldk 10y ago
How is that number calculated? It's less than 2^25 but greater than 2^24
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.
- bArray 10y agoOkay, that makes sense - thanks! I guess there's an upper limit to that number too? It's probably squeezing into a 32 or 64 bit number?
- danieldk 10y agoThere is probably a upper limit, but practically you don't want more inodes than blocks. Since a non-empty file at least takes up one block, assuming that your files are all at least 1 byte, you couldn't use more inodes than blocks anyway. (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.)
- majewsky 10y agoIf I'm not mistaken, some file systems store file contents smaller than a block directly inside the respective directory entry.