1E4DEFRAG(8)                 System Manager's Manual                E4DEFRAG(8)
2
3
4

NAME

6       e4defrag - online defragmenter for ext4 file system
7

SYNOPSIS

9       e4defrag [ -c ] [ -v ] target ...
10

DESCRIPTION

12       e4defrag  reduces fragmentation of extent based file. The file targeted
13       by e4defrag is created on ext4 file system made with "-O extent" option
14       (see mke2fs(8)).  The targeted file gets more contiguous blocks and im‐
15       proves the file access speed.
16
17       target is a regular file, a directory, or a device that is  mounted  as
18       ext4  file system.  If target is a directory, e4defrag reduces fragmen‐
19       tation of all files in it. If target is a  device,  e4defrag  gets  the
20       mount  point of it and reduces fragmentation of all files in this mount
21       point.
22

OPTIONS

24       -c     Get a current fragmentation count  and  an  ideal  fragmentation
25              count,  and calculate fragmentation score based on them. By see‐
26              ing this score, we can determine whether we should execute e4de‐
27              frag  to target.  When used with -v option, the current fragmen‐
28              tation count and the ideal fragmentation count are  printed  for
29              each file.
30
31              Also this option outputs the average data size in one extent. If
32              you see it, you'll find the file has ideal extents or not.  Note
33              that the maximum extent size is 131072KB in ext4 file system (if
34              block size is 4KB).
35
36              If this option is specified, target is never defragmented.
37
38       -v     Print error messages and the fragmentation count before and  af‐
39              ter defrag for each file.
40

NOTES

42       e4defrag does not support swap file, files in lost+found directory, and
43       files allocated in indirect blocks. When target is a device or a  mount
44       point,  e4defrag  doesn't  defragment files in mount point of other de‐
45       vice.
46
47       It is safe to run e4defrag on a file while it is actively in use by an‐
48       other  application.  Since the contents of file blocks are copied using
49       the page cache, this can result in a performance slowdown to both e4de‐
50       frag and the application due to contention over the system's memory and
51       disk bandwidth.
52
53       If the file system's free space is fragmented, or if there is  insuffi‐
54       cient  free  space  available,  e4defrag may not be able to improve the
55       file's fragmentation.
56
57       Non-privileged users can execute e4defrag to their own  file,  but  the
58       score is not printed if -c option is specified. Therefore, it is desir‐
59       able to be executed by root user.
60

AUTHOR

62       Written by Akira Fujita <a-fujita@rs.jp.nec.com> and Takashi  Sato  <t-
63       sato@yk.jp.nec.com>.
64

SEE ALSO

66       mke2fs(8), mount(8).
67
68
69
70
71e4defrag version 2.0               May 2009                        E4DEFRAG(8)
Impressum