0

How can I find out if I formatted the drive with

mkfs.ext4 -m 0 -T largefile4

or without specifying the options -m and -T

mkfs.ext4

In other words how can I see what is the -m reserved-blocks-percentage and -T usage-type of a formatted drive?

1 Answers1

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:

  1. Get block device size by running df -k /path/to/filesystem.
  2. Take the value from 1K-blocks column and multiply by 1024.
  3. Run dumpe2fs /path/to/filesystem | grep "Inode count" to get the number of inodes on the filesystem.
  4. 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.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
  • It returns: Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum Journal features: (none) – ThomasHunter Dec 01 '21 at 23:17
  • Sorry, I missed some points of the original question, I updated the answer. – Tero Kilkanen Dec 02 '21 at 07:02