[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <PAsXqba23hYRwwgFsaneY7Hmxe8-AmdAhSAUH2CW_vtTAi0Y8wVch4QrmW-gU2KahqhsxpxHesEDBZSXlM70jazF0yC-DaPfWgFckG6uzXo=@proton.me>
Date: Wed, 17 Dec 2025 18:04:22 +0000
From: Daniel Mazon <daniel.mazon@...ton.me>
To: "linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>
Subject: ext4: a tool to modify the inode count
Hello,
I wrote a small tool to modify the inode count of an existing ext4
filesystem. It is largely based on the resize2fs tool from e2fsprogs.
Previously, the inode count was selected at filesystem creation and
could not be modified afterwards.
It provides a way to increase or reduce the inode count. I developed it
because I had a 3.5 TiB ext4 partition created with a default 16384
bytes-per-inode ratio. This created over 200 million inodes, allocating
over 50GiB to inode tables. However, I was using less than 0.1% of
inodes, so I wanted to reallocate those unused GiB from inode tables to
free space.
To test the program, I created testcases trying to cover all possible
ext4 options that could be impacted by a change on the inode count.
After some time, I think it works well: no fsck errors after the
change, and all data is still there. Please bear in mind that this has
only been tested by one person.
I think this tool could be useful to someone else, as it adds
flexibility on a parameter which was previouly unmodifiable. The code
can be found here: https://github.com/danim7/inode_count_modifier
Please don't hesitate to let me know if you give it a try. I hope this
mailing list is the right place to communicate this, if not, please
excuse me for the noise.
Regards,
Daniel
Powered by blists - more mailing lists