File: defrag.8

package info (click to toggle)
defrag 0.73-1
  • links: PTS
  • area: main
  • in suites: hamm, potato, slink
  • size: 384 kB
  • ctags: 599
  • sloc: ansic: 4,463; makefile: 137; sh: 37
file content (172 lines) | stat: -rw-r--r-- 4,922 bytes parent folder | download
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
.TH DEFRAG 8 "Version 0.73   25 Jan 1998"
.SH NAME
[ex][2]defrag - defragment file systems.
.SH SYNOPSIS
.B defrag
|
.B edefrag 
| 
.B e2defrag
| 
.B xdefrag
[
.B -Vdnrsv
] [
.B -b
.I bad-inode
] [
.B -i
.I inode-list
] [
.B -p 
.I pool-size
]
.I /dev/name

.SH DESCRIPTION
.I Defrag 
will reorganise data on a minix file system partition in order
to improve the file system's performance.
.I Edefrag 
is the equivalent
program for the extended file system.
.I E2defrag 
in its turn is designed for the second extended file system (versions
0.3 onwards). And the
.I xdefrag
program will operate on Xia FS filesystems.

.PP
Note that unlike the
.I fsck
program,
.I defrag
MUST NOT be run on a mounted file system device (unless invoked with
the
.B -r
(readonly) option, which is always safe).  Also note that if you
defragment a partition containing a bootable kernel image, you will
have to reinstall the boot loader for that image (since the location
on disk of the image may have changed).
.PP
Remember, if
.I defrag
fails to complete for any reason (including power glitches, kernel
bugs etc.), you will be left with a terminally sick, and possibly
completely unreadable, filesystem, so backup any valuable data before
you start.
.SH OPTIONS
.TP
.B -V
Supply full version information.  If you are sending bug reports,
please include this information.
.TP
.B -d
Run in debugging mode.  This will not be available if disabled at
compile-time.
.TP
.B -n
No-picture more.  Disables a pseudo-graphic picture and runs with an
old-style printf output. Note that the picture option requires a
proper terminfo database for your terminal, compatible with the
ncurses package.  If the picture option is used,
.B -v 
and
.B -s 
options are set automatically. Nevertheless you can increase amount of
information output to the status line using several
.B -v 
switches. This gives you a chance to improve the speed of your reading.
.TP
.B -r
Readonly mode.  
.I Defrag
will scan the file system and simulate the job of defragmentation, but
will not write to the file system.  This can be used for debugging or
testing.  It may also be used to find out how much work
.I defrag
will have to do, in order to choose a sensible
.I pool-size
.
.TP
.B -s
Summarise file system information and
.I
defrag
performance statistics.
.TP
.B -v
Verbose - gives a progress report as defragmentation proceeds.  If
.B -v
is given twice, then a more detailed report is supplied.  The fullest
report, when
.B -v
is given three times, also reports the inode priority
list as it is read.
.TP
.BI -b " bad-inode"
Indicate which inode stores the badblock list on the filesystem being
defragmented.  This should be an inode whose data blocks are all bad
blocks.  The defragmenter will not move these blocks, and will prevent
any other data from being placed there.

The default for edefrag is
.B -b
2, since 
.I mkefs
always creates a bad block inode at inode 2.  The minix filesystem
does not have a bad block inode by default, but if you have created
one, supply its inode number with this option.
.TP
.BI -i " inode-list"
As of version 0.4, 
.I defrag
has a new facility which allows you to specify how to reorganise the
data on your disk.  The 
.I inode-list
is an optional file giving a priority between -100 and 100 to each
inode in the filesystem.  Higher priorities will be allocated nearer
the beginning of the disk than lower (more negative) priorities.  Two
inodes of equal priority will be allocated in the same sequence they
had originally on the filesystem, to minimise file movement.  All
inodes have a default priority of zero if they are ommitted from the
file or if no
.B -i
option is given.

The file 
.I inode-list
should contain a series of lines containing either a single number
(which will be interpreted as an inode number), or a number prefixed
immediately by an equals sign (which will be interpreted as a priority
to be applied to the subsequent inode numbers).
.TP
.BI -p " number"
Selects the number of buffers allocated to the defragmenter's buffer
pool.  These buffers are used when relocating data, so the more
buffers allocated, the more efficient the relocation process.  The
number you choose will depend on how much physical and virtual memory
you have available.  The default pool size is 512 buffers (equivalent
to 512kB of memory used for filesystems with the default 1kB block
size).
.SH "SEE ALSO"
.BR mkfs (8),
.BR fsck (8),
.BR mkefs (8),
.BR efsck (8),
.BR mke2fs (8),
.BR e2fsck (8)
.SH BUGS
Maybe, but then that's why you backed up your data first, isn't it?
.SH AUTHORS
.LP
Written by Stephen Tweedie.  Adaptation for the xia, ext2 filesystem
and the picture option are done by Alexey Vovenko and Ulrich Habel.  
Much of the initial version was developed from the
.I fsck
and
.I efsck
programs by Linus Torvalds and Remy Card.

Send bug reports, fixes, improvements, comments and fan-mail to
sct@dcs.ed.ac.uk.