e4defrag
github.com
- Free plan
- Linux
What e4defrag is
e4defrag is a free Linux utility for defragmenting extent-based files on ext4 filesystems. It can target a regular file, a directory and its files, or an ext4 device. The tool aims to place a target’s data in more contiguous blocks, which its manual says can improve file access speed. Use the -c option to check fragmentation counts and a score without defragmenting; the score appears only when the check is run as root. The -v option displays error messages and each file’s fragmentation count before and after defragmentation. e4defrag checks that the filesystem is ext4 and reports an error for other filesystem types. It does not support swap files, files in lost+found, or files allocated in indirect blocks. A device or mount-point target excludes files belonging to another device’s mount point. Fragmented or insufficient free space can prevent improvement. The manual says it is safe to run while another application uses a file, though shared memory and disk bandwidth can slow both. Non-privileged users can run it on their own files.
Who it suits
e4defrag suits Linux users who need to check or defragment files on an ext4 filesystem. It is intended for targeted files, directories or ext4 devices rather than unsupported file types or other filesystems.
Good to know, and what to watch
- Checks fragmentation without modifying the target.
- Verbose mode reports counts before and after.
- Non-privileged users can run it on their own files.
- Can run while another application uses a file.
- Only ext4 filesystems are supported.
- Swap files and files in lost+found are unsupported.
- Indirect-block files are unsupported.
- Insufficient or fragmented free space can prevent improvement.
Plans
Every plan and pricee4defrag
Open source
The verdict
e4defrag offers targeted defragmentation and a non-modifying fragmentation check for ext4. Its supported file types and available free space can limit what it improves.
What the maker publishes
- Authors
- The e4defrag source credits Akira Fujita and Takashi Sato as authors. source
- Defragmentation
- It aims to give targeted files more contiguous blocks, which the manual says improves file access speed. source
- Fragmentation check
- The -c option reports current and ideal fragmentation counts and a fragmentation score without defragmenting the target. source
- Free space
- Fragmented or insufficient filesystem free space can prevent e4defrag from improving a file’s fragmentation. source
- Other mount points
- When given a device or mount point, it does not defragment files belonging to another device’s mount point. source
- Permissions
- Non-privileged users can run it on their own files, but the fragmentation score is not printed for -c runs unless run as root. source
- Project
- The maker’s README describes e2fsprogs as second extended filesystem management programs and says it supplies instructions for building and installing them. source
- Purpose
- e4defrag is an online defragmenter for extent based files on ext4 filesystems. source
- Support
- The project README directs bug reports for its programs to Ted Ts’o by email. source
- Supported filesystem
- The source checks for ext4 and reports an error when the filesystem is not ext4. source
- Targets
- It accepts a regular file, directory, or device mounted as ext4; a directory target covers its files. source
- Unsupported files
- The manual says e4defrag does not support swap files, files in lost+found, or files allocated in indirect blocks. source
- Use while active
- The manual says it is safe to run on a file while another application uses it, though shared memory and disk bandwidth can slow both. source
- Verbose output
- The -v option prints error messages and each file’s fragmentation count before and after defragmentation. source
Checked against the maker's pages on 4 Oct 2026.