mkfs.ext4 -m -T options
Solution 1:
Execute as root:
dumpe2fs | less
There is a line Reserved block count
, which tells how many blocks are reserved. Dividing Reserved block count
by Block count
gets you the percentage of reserved blocks.
The -T
option selects which configuration to use from /etc/mke2fs.conf
. The main setting that changes is the inode_ratio
, which tells how much filesystem space one inode covers.
To get back to that number, one needs to do following steps:
- Get block device size by running
df -k /path/to/filesystem
. - Take the value from
1K-blocks
column and multiply by 1024. - Run
dumpe2fs /path/to/filesystem | grep "Inode count"
to get the number of inodes on the filesystem. - Divide the value from step 2 by the value from step 3.
The result is a number close to 4194304, which is the inode_ratio
specified for largefile4
in mke2fs.conf
, if the filesystem was created with largefile4
option.