E2FREEFRAG(8)
๐ E2FREEFRAG โ the manual page, bestie edition ๐
okay so real talk: this is e2freefrag, from section 8 of the System Manager's Manual (yes that's the "sysadmin commands" shelf, very main character). Let's get into it ๐ซถ
โจ NAME โจ
e2freefrag โ report free space fragmentation information
๐ธ SYNOPSIS ๐ธ
e2freefrag [ -c chunk_kb ] [ -h ] filesys
๐ฆ DESCRIPTION ๐ฆ
okay so e2freefrag is the girl who tells you how fragmented the free space on your ext2/3/4 file systems is. She's nosy in the best way ๐
filesys is the file system device name โ think /dev/hdc1, /dev/md0, that whole vibe.
What she actually does: she scans the block bitmap information to check how many free blocks are chillin' there as contiguous and aligned free space. Then she reports the percentage of contiguous free blocks of size and of alignment chunk_kb. โจ
She also serves you the minimum/maximum/average free chunk size in the file system, plus a whole histogram of all free chunks. Iconic, honestly.
What's it all for? So you can gauge the level of free space fragmentation in the file system. iykyk ๐ฅ
๐ OPTIONS ๐
-c chunk_kbโ if you specify a chunk size,e2freefragwill print how many free chunks of sizechunk_kbare available, in units of kilobytes (Kb). โ ๏ธ heads up bestie: the chunk size must be a power of two and must be larger than the file system block size. no cap.-hโ prints the usage of the program. the classic "help me pls" button ๐
๐ EXAMPLE ๐
# e2freefrag /dev/vgroot/lvhome
Device: /dev/vgroot/lvhome
Blocksize: 4096 bytes
Total blocks: 1504085
Free blocks: 292995 (19.5%)
Min. free extent: 4 KB
Max. free extent: 24008 KB
Avg. free extent: 252 KB
HISTOGRAM OF FREE EXTENT SIZES:
Extent Size Range : Free extents Free Blocks Percent
4K... 8K- : 704 704 0.2%
8K... 16K- : 810 1979 0.7%
16K... 32K- : 843 4467 1.5%
32K... 64K- : 579 6263 2.1%
64K... 128K- : 493 11067 3.8%
128K... 256K- : 394 18097 6.2%
256K... 512K- : 281 25477 8.7%
512K... 1024K- : 253 44914 15.3%
1M... 2M- : 143 51897 17.7%
2M... 4M- : 73 50683 17.3%
4M... 8M- : 37 52417 17.9%
8M... 16M- : 7 19028 6.5%
16M... 32M- : 1 6002 2.0%
look at that histogram, she ATE ๐โญ
๐ AUTHOR ๐
This version of e2freefrag was written by Rupesh Thakare, and modified by Andreas Dilger <adilger@sun.com>, and Kalpak Shah. legends only ๐ซถ
๐ SEE ALSO ๐
debugfs(8), dumpe2fs(8), e2fsck(8)
and that's the whole page bestie ๐ this was E2fsprogs version 1.47.4, dated March 2025 โ slay, stay unfragmented, mwah ๐ โจ๐
๐ฆ where this page comes from
- alpine 3.24: e2fsprogs-doc 1.47.4-r0 ยท GPL-2.0-or-later AND LGPL-2.0-or-later AND BSD-3-Clause AND MIT
- arch rolling: e2fsprogs 1.47.4-1 ยท GPL AND LGPL AND MIT
- nixpkgs unstable: e2fsprogs 1.47.4
- ubuntu stonking: e2fsprogs 1.47.4-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms