Defragment Ubuntu, Fedora, ext3, ext4
Defragmentation is not necessary on Ubuntu, Fedora, or other Linux implementations when you use the ext3 file system. This is because it is designed to reduce fragmentation, it tries to allocate a free block nearest to others blocks for the same file.
Wikipedia says there are user space tools for defragmenting ext3, however, “A true defragmentation tool does not exist for ext3“.”
There are userspace defragmentation tools like Shake and defrag. Shake works by allocating space for the whole file bolt upright and hoping that it will make the newly allocated file less fragmented. It also tries to write files used at the same time next to each other. Defrag works by copying each file over itself. However they only work if the filesystem is reasonably empty. A true defragmentation tool does not exist for ext3.
How to find out if ext3 file system is fragmented?
- Overview: Fragmentation and Unix file systems
- Measuring fragmentation on ext3 in Linux
- Determining file fragmentation on ext3 file systems
- Measuring ext3 fragmentation – Tools and Techniques
- ext4 supports online defragmentation
- How to get ext4 for Ubuntu and Fedora
- Tools: ext4 defragemntation with e4defrag
There are no programs to specifically defragment a ReiserFS file system, although tools have been written to automatically copy the contents of fragmented files hoping that more contiguous blocks of free space can be found. However, Reiser4 will have a repacker that optimizes file fragmentation