summaryrefslogtreecommitdiffstats
path: root/upstream/debian-bookworm/man8/e4defrag.8
blob: 53d7f17dfcf0427b40cfa69a074f3903ade85eaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.TH E4DEFRAG 8 "May 2009" "e4defrag version 2.0"
.SH NAME
e4defrag \- online defragmenter for ext4 file system
.SH SYNOPSIS
.B e4defrag
[
.B \-c
]
[
.B \-v
]
.I target
\&...
.SH DESCRIPTION
.B e4defrag
reduces fragmentation of extent based file. The file targeted by
.B e4defrag
is created on ext4 file system made with "-O extent" option (see
.BR mke2fs (8)).
The targeted file gets more contiguous blocks and improves the file access
speed.
.PP
.I target
is a regular file, a directory, or a device that is mounted as ext4 file system.
If
.I target
is a directory,
.B e4defrag
reduces fragmentation of all files in it. If
.I target
is a device,
.B e4defrag
gets the mount point of it and reduces fragmentation of all files in this mount
point.
.SH OPTIONS
.TP
.B \-c
Get a current fragmentation count and an ideal fragmentation count, and
calculate fragmentation score based on them. By seeing this score, we can
determine whether we should execute
.B e4defrag
to
.IR target .
When used with
.B \-v
option, the current fragmentation count and the ideal fragmentation count are
printed for each file.
.IP
Also this option outputs the average data size in one extent. If you see it,
you'll find the file has ideal extents or not. Note that the maximum extent
size is 131072KB in ext4 file system (if block size is 4KB).
.IP
If this option is specified,
.I target
is never defragmented.
.TP
.B \-v
Print error messages and the fragmentation count before and after defrag for
each file.
.SH NOTES
.B e4defrag
does not support swap file, files in lost+found directory, and files allocated
in indirect blocks. When
.I target
is a device or a mount point,
.B e4defrag
doesn't defragment files in mount point of other device.
.PP
It is safe to run e4defrag on a file while it is actively in use by another
application.  Since the contents of file blocks are copied using the
page cache, this can result in a performance slowdown to both e4defrag
and the application due to contention over the system's memory and disk
bandwidth.
.PP
If the file system's free space is fragmented, or if there is
insufficient free space available, e4defrag may not be able
to improve the file's fragmentation.
.PP
Non-privileged users can execute
.B e4defrag
to their own file, but the score is not printed if
.B \-c
option is specified. Therefore, it is desirable to be executed by root user.
.SH AUTHOR
Written by Akira Fujita <a-fujita@rs.jp.nec.com> and Takashi Sato
<t-sato@yk.jp.nec.com>.
.SH SEE ALSO
.BR mke2fs (8),
.BR mount (8).