| 1 |
.\" -*- nroff -*- |
| 2 |
.TH FILEFRAG 8 "March 2025" "E2fsprogs version 1.47.4" |
| 3 |
.SH NAME |
| 4 |
filefrag \- report on file fragmentation |
| 5 |
.SH SYNOPSIS |
| 6 |
.B filefrag |
| 7 |
[ |
| 8 |
.BI \-b blocksize |
| 9 |
] |
| 10 |
[ |
| 11 |
.B \-BeEkPsvVxX |
| 12 |
] |
| 13 |
[ |
| 14 |
.I files... |
| 15 |
] |
| 16 |
.SH DESCRIPTION |
| 17 |
.B filefrag |
| 18 |
reports on how badly fragmented a particular file might be. It makes |
| 19 |
allowances for indirect blocks for ext2 and ext3 file systems, but can be |
| 20 |
used on files for any file system. |
| 21 |
.PP |
| 22 |
The |
| 23 |
.B filefrag |
| 24 |
program initially attempts to get the |
| 25 |
extent information using FIEMAP ioctl which is more efficient and faster. |
| 26 |
If FIEMAP is not supported then filefrag will fall back to using FIBMAP. |
| 27 |
.SH OPTIONS |
| 28 |
.TP |
| 29 |
.B \-B |
| 30 |
Force the use of the older FIBMAP ioctl instead of the FIEMAP ioctl for |
| 31 |
testing purposes. |
| 32 |
.TP |
| 33 |
.BI \-b blocksize |
| 34 |
Use |
| 35 |
.I blocksize |
| 36 |
in bytes, or with [KMG] suffix, up to 1GB for output instead of the |
| 37 |
file system blocksize. For compatibility with earlier versions of |
| 38 |
.BR filefrag , |
| 39 |
if |
| 40 |
.I blocksize |
| 41 |
is unspecified it defaults to 1024 bytes. Since |
| 42 |
.I blocksize |
| 43 |
is an optional argument, it must be added without any space after |
| 44 |
.BR -b . |
| 45 |
.TP |
| 46 |
.B \-e |
| 47 |
Print output in extent format, even for block-mapped files. |
| 48 |
.TP |
| 49 |
.B \-E |
| 50 |
Display the contents of ext4's extent status cache. This feature is not |
| 51 |
supported on all kernels, and is only supported on ext4 file systems. |
| 52 |
.TP |
| 53 |
.B \-k |
| 54 |
Use 1024\-byte blocksize for output (identical to '\-b1024'). |
| 55 |
.TP |
| 56 |
.B -P |
| 57 |
Pre-load the ext4 extent status cache for the file. This is not |
| 58 |
supported on all kernels, and is only supported on ext4 file systems. |
| 59 |
.TP |
| 60 |
.B \-s |
| 61 |
Sync the file before requesting the mapping. |
| 62 |
.TP |
| 63 |
.B \-v |
| 64 |
Be verbose when checking for file fragmentation. |
| 65 |
.TP |
| 66 |
.B \-V |
| 67 |
Print version number of program and library. If given twice, also |
| 68 |
print the FIEMAP flags that are understood by the current version. |
| 69 |
.TP |
| 70 |
.B \-x |
| 71 |
Display mapping of extended attributes. |
| 72 |
.TP |
| 73 |
.B \-X |
| 74 |
Display extent block numbers in hexadecimal format. |
| 75 |
.SH AUTHOR |
| 76 |
.B filefrag |
| 77 |
was written by Theodore Ts'o <[email protected]>. |