LinuxCommandLibrary

e2freefrag

analyze ext filesystem free space fragmentation

TLDR

Check free space fragmentation

$ e2freefrag [/dev/sdXN]
copy
Check with specific chunk size
$ e2freefrag -c [chunk_size_in_kb] [/dev/sdXN]
copy

SYNOPSIS

e2freefrag [options] device

DESCRIPTION

e2freefrag prints free space fragmentation information for ext2/ext3/ext4 filesystems. It shows how many free blocks are available as contiguous and aligned free space in histogram format.
The tool analyzes the filesystem's free space distribution, reporting statistics about chunk sizes and their frequency. This information helps assess filesystem health and determine if defragmentation might improve performance.
Useful for identifying fragmentation patterns that could impact sequential I/O performance, particularly on systems with large files or database workloads.

PARAMETERS

-c size

Chunk size in KB for histogram
device
Filesystem device to analyze

CAVEATS

Filesystem should be unmounted or mounted read-only for accurate results. Part of e2fsprogs package.

SEE ALSO

e4defrag(8), dumpe2fs(8), e2fsck(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community