# E4DEFRAG - online defragmenter for ext4 file system - man(8) - [phpMan]

[_E4DEFRAG_(8)](https://www.chedong.com/phpMan.php/man/E4DEFRAG/8/markdown)                            System Manager's Manual                           [_E4DEFRAG_(8)](https://www.chedong.com/phpMan.php/man/E4DEFRAG/8/markdown)

## NAME
       e4defrag - online defragmenter for ext4 file system

## SYNOPSIS
       **e4defrag **[ **-c **] [ **-v **] _target_ ...

## DESCRIPTION
       **e4defrag **reduces fragmentation of extent based file. The file targeted by **e4defrag **is created
       on  ext4  file  system  made with "-O extent" option (see [**mke2fs**(8)](https://www.chedong.com/phpMan.php/man/mke2fs/8/markdown)).  The targeted file gets
       more contiguous blocks and improves the file access speed.

       _target_ is a regular file, a directory, or a device that is mounted as ext4 file  system.   If
       _target_  is a directory, **e4defrag **reduces fragmentation of all files in it. If _target_ is a de‐
       vice, **e4defrag **gets the mount point of it and reduces fragmentation  of  all  files  in  this
       mount point.

## OPTIONS
### -c     
              fragmentation score based on them. By seeing this score, we can determine  whether  we
              should  execute  **e4defrag **to _target_.  When used with **-v **option, the current fragmenta‐
              tion count and the ideal fragmentation count are printed for each file.

              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).

              If this option is specified, _target_ is never defragmented.

### -v     
              file.

## NOTES
       **e4defrag  **does  not  support swap file, files in lost+found directory, and files allocated in
       indirect blocks. When _target_ is a device or a mount point, **e4defrag **doesn't defragment  files
       in mount point of other device.

       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  per‐
       formance  slowdown  to  both e4defrag and the application due to contention over the system's
       memory and disk bandwidth.

       If the file system's free space is fragmented, or if there is insufficient free space  avail‐
       able, e4defrag may not be able to improve the file's fragmentation.

       Non-privileged  users can execute **e4defrag **to their own file, but the score is not printed if
### -c 

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

## SEE ALSO
       [**mke2fs**(8)](https://www.chedong.com/phpMan.php/man/mke2fs/8/markdown), [**mount**(8)](https://www.chedong.com/phpMan.php/man/mount/8/markdown).


e4defrag version 2.0                          May 2009                                   [_E4DEFRAG_(8)](https://www.chedong.com/phpMan.php/man/E4DEFRAG/8/markdown)
