Originally posted by birdie
View Post
Defrag free space on ext4 is total stupid but doable. Yes this is a tooling issue not a file system limitation.
-M Shrink the filesystem to the minimum size and then restore. This has to be done with the file system offline. The code to perform free space defragmentation is in the resize2fs it would be good if you could do a Shrink File system to minimum size without resizing the file structures. So this is not ext4 limitation its the tools are horrible to-do it. the number of inodes can't be changed after FS creation
Not exactly true this is another thing resize2fs can increase or reduce inode count while file system is offline while changing the file systems size. The size of a inode cannot be changed so if you don't change the size of the file system you cannot change the inode count.
files can't be defragmented for no reasons
https://manpages.ubuntu.com/manpages...4defrag.8.html -v will tell you why a file has refused to defrag. In fact at times it can tell you other files that need to go first.
The resize2fs I will give you is a really stupid item to have to use to change inode counts and defrag free space.
Comment