E2FREEFRAG(8) System Manager's Manual E2FREEFRAG(8)NAME
e2freefrag - report free space fragmentation information
SYNOPSIS
e2freefrag [ -c chunk_kb ] [ -h ] filesys
DESCRIPTION
e2freefrag is used to report free space fragmentation on ext2/3/4 file systems. filesys is the filesystem device name (e.g. /dev/hdc1,
/dev/md0). The e2freefrag program will scan the block bitmap information to check how many free blocks are present as contiguous and
aligned free space. The percentage of contiguous free blocks of size and of alignment chunk_kb is reported. It also displays the mini-
mum/maximum/average free chunk size in the filesystem, along with a histogram of all free chunks. This information can be used to gauge
the level of free space fragmentation in the filesystem.
OPTIONS -c chunk_kb
If a chunk size is specified, then e2freefrag will print how many free chunks of size chunk_kb are available in units of kilobytes
(Kb). The chunk size must be a power of two and be larger than filesystem block size.
-h Print the usage of the program.
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%
AUTHOR
This version of e2freefrag was written by Rupesh Thakare, and modified by Andreas Dilger <adilger@sun.com>, and Kalpak Shah.
SEE ALSO debugfs(8), dumpe2fs(8), e2fsck(8)E2fsprogs version 1.41.11 March 2010 E2FREEFRAG(8)
Check Out this Related Man Page
FSTRIM(8) System Administration FSTRIM(8)NAME
fstrim - discard unused blocks on a mounted filesystem
SYNOPSIS
fstrim [-o offset] [-l length] [-m minimum-free-extent] [-v] mountpoint
DESCRIPTION
fstrim is used on a mounted filesystem to discard (or "trim") blocks which are not in use by the filesystem. This is useful for solid-
state drives (SSDs) and thinly-provisioned storage.
By default, fstrim will discard all unused blocks in the filesystem. Options may be used to modify this behavior based on range or size,
as explained below.
The mountpoint argument is the pathname of the directory where the filesystem is mounted.
OPTIONS
The offset, length, and minimum-free-extent arguments may be followed by the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for
GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g. "K" has the same meaning as "KiB") or the suffixes KB=1000, MB=1000*1000, and
so on for GB, TB, PB, EB, ZB and YB.
-h, --help
Print help and exit.
-o, --offset offset
Byte offset in filesystem from which to begin searching for free blocks to discard. Default value is zero, starting at the begin-
ning of the filesystem.
-l, --length length
Number of bytes after starting point to search for free blocks to discard. If the specified value extends past the end of the
filesystem, fstrim will stop at the filesystem size boundary. Default value extends to the end of the filesystem.
-m, --minimum minimum-free-extent
Minimum contiguous free range to discard, in bytes. (This value is internally rounded up to a multiple of the filesystem block
size). Free ranges smaller than this will be ignored. By increasing this value, the fstrim operation will complete more quickly
for filesystems with badly fragmented freespace, although not all blocks will be discarded. Default value is zero, discard every
free block.
-v, --verbose
Verbose execution. When specified fstrim will output the number of bytes passed from the filesystem down the block stack to the
device for potential discard. This number is a maximum discard amount from the storage device's perspective, because FITRIM ioctl
called repeated will keep sending the same sectors for discard repeatedly.
fstrim will report the same potential discard bytes each time, but only sectors which had been written to between the discards would
actually be discarded by the storage device. Further, the kernel block layer reserves the right to adjust the discard ranges to fit
raid stripe geometry, non-trim capable devices in a LVM setup, etc. These reductions would not be reflected in fstrim_range.len
(the --length option).
AUTHOR
Lukas Czerner <lczerner@redhat.com>
Karel Zak <kzak@redhat.com>
SEE ALSO mount(8)AVAILABILITY
The fstrim command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
util-linux November 2010 FSTRIM(8)