E4RAT-REALLOC(8)

NAME
e4rat-realloc - Reallocation and defragmentation of relevant files

SYNOPSIS
e4rat-realloc [ option(s) ] [ mode ] file(s)

DESCRIPTION
e4rat-realloc is a relevant file defrag program based on EXT4_IOC_MOVE_EXT ioctl from ext4 filesystems. It physically places files into a sequence of neighbouring blocks on disk. The reallocation process can be done when the filesystem is still mounted. For security reasons write access to each file is needed.

If you want to process files from a program it is recommended to kill them at first. Linux does not allow to open files writable while it is still executed. So it is not possible to process the program executable binary. Those files get excluded automatically.

Add list files to be proceeded either as parameters and/or over stdin. The list file(s) must be in a format generated by e4rat-collect.

OPTIONS

-V --version
    show version information and exit.

-h --help
    display usage message and exit.

-v --verbose
    increment verbosity level.

-q --quiet
    set verbosity level to 0. This means that no messages will be displayed.

-l --loglevel <number>
    set loglevel to <number>. All log messages are sent either to the Kernel log (see dmesg(1)) or to syslog(3).

-f --force
    force reallocating files even though it will get worse afterwards.

DEFRAG MODES

-p --use-prealloc
    use the pre-allocation ioctl to rearrange files on disk. Furthermore this mode supports to eliminate gaps of unallocated blocks in sparse files. Unfortunately, this ioctl is presently under heavy development by Kazuya Mio and has not yet entered the Linux Kernel. Therefore you have to apply this Kernel patch fist: http://kt1.osuosl.org/mailarchive/linux-fsdevel/2010/12/1/6887724 Do this at your own risk.

-g --use-locality-group
    The ext4 filesystem allocates small files in so-called locality groups. Each CPU manages its own group. The "locality-group" method makes use of this feature in order to rearrange the files on disk. In contrast to the "prealloc" method, no kernel patch is required. However, the placement may me suboptimal. While creating donor files is in progress, it is necessary to increase the limit which indicates small files. As a result other allocation requests occurring at the same time will be also satisfied with blocks from the locality group as well. It is the best if you just avoid heavy write access to disk.

-t --use-tld
    select the "use-tld" method to rearrange files on disk. With this method, all donor files are created in a new top level directory. The so-called Orlov algorithm put top level directory into an empty block group. As a result, donor files will be allocated near this directory. But there is no guarantee that the donor files are allocated in their access order.

    Also, ext4's block allocator normalizes every block request to a power of 2. This typically leads to small holes between the files.

FILES
/etc/e4rat.conf
     E4rat configuration file.

AUTHOR
Written by Andreas Rid and Gundolf Kiefer.

REPORTING BUGS
Report bugs to Andreas Rid <conso at users.sf.net>.

SEE ALSO
e4rat-collect(8), e4rat-preload(8), e4rat.conf(8)