ext4 filesystems need to be defragmented? If so, how do I defragment them?
If not, could you post a simple explanation of why they do not need to be defragmented?
Yes (but very rarely).
Copy all the files off the partition, erase the files from the partition, then copy the files back onto the partition. The file system will intelligently allocate the files as you copy them back onto the disk.
I have been using ext4 partition for over a year. I often run out of space, moved a lots of files in and out etc etc... these things are bad for fragmentation and yesterday I checked for fragmentation for the first time and only 2 files (not % just two files) were fragmented
on windows partition that was used for about a year longer with much more free space available I have 95% fragmentation...
so no you really dont need to defragment ext4 and if you want to be sure, leave the default free space for ext4 (default is 5%, can be changet by ex2tunefs -m X)
Thank you for your interest in this question.
Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.
Would you like to answer one of these unanswered questions instead?