Ext4 defragmentation with e4defrag

Filed under
HowTos

Lately I have described ok_defrag — a simple tool for defragmenting Linux file systems. Today, I want to describe a specialized program designed to defrag the new Ext4 file system.

To begin playing with e4defrag we must start compile of new kernel with patches needed to carry out the defragmentation. Below you will find a short description of that process, and if you would not like to use all those experimental patches for Ext4, then you should be interested in these seven only:

ext4-online-defrag-exchange-blocks-between-two-inodes.patch
ext4-online-defrag-relocate-file-data.patch
ext4-online-defrag-alloc-contiguous-blks.patch
ext4-online-defrag-ext4-defrag.patch
ext4-online-defrag-for-relevant-files.patch
ext4-online-defrag-check-for-freespace-fragmentation.patch
ext4-online-defrag-move-victim-files.patch

In first step we start from creation of directory, grabbing the kernel source, and downloading and unpacking needed patches.

More Here