e2defrag8
Defragment file systems.
Part of defrag(8).
Usage
edefrag { | e2defrag | mdefrag | xdefrag
[-Vdnrsv]
[-b
bad-inode]
[-i
inode-priority-file]
[-p
pool-size]
/dev/name}
Overview
Mdefrag will reorganise data on a minix file system partition in order to improve the file system's performance. Edefrag is the equivalent program for the old extended file system. E2defrag in its turn is designed for the second extended file system (versions 0.3 onwards). And the xdefrag program will operate on Xia FS filesystems.
Note that unlike the fsck program, defrag MUST NOT be run on a mounted file system device (unless invoked with the -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).
Remember, if 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.
Options
-
-V -
Supply full version information. If you are sending bug reports, please include this information.
-
-d -
Run in debugging mode. This will not be available if disabled at compile-time.
-
-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,
-vand-soptions are set automatically. Nevertheless you can increase amount of information output to the status line using several-vswitches. This gives you a chance to improve the speed of your reading.
-
-r -
Readonly mode. 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 defrag will have to do, in order to choose a sensible pool-size
-
-s -
Summarise file system information and defrag performance statistics.
-
-v -
Verbose - gives a progress report as defragmentation proceeds. If
-vis given twice, then a more detailed report is supplied. The fullest report, when-vis given three times, also reports the inode priority list as it is read.
-bbad-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
-b2, since 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.
-iinode-priority-file-
As of version 0.4, defrag has a new facility which allows you to specify how to reorganise the data on your disk. The inode-priority-file is a 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
-ioption is given.The file inode-priority-file 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).
If multiple priority files are specified, only the last one is effective.
-pnumber-
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 2MB of memory used for filesystems with the default 4kB block size of current mke2fs versions).
History
- Debian 3.1 (Sarge) to Debian 3.0 (Woody): the text shown here
- Debian 2.2 (Potato) to Debian 2.0 (Hamm)
- Debian 1.3 (Bo)