{
    "mode": "man",
    "parameter": "e4defrag",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/e4defrag/8/json",
    "generated": "2026-06-10T16:17:48Z",
    "synopsis": "e4defrag [ -c ] [ -v ] target ...",
    "sections": {
        "NAME": {
            "content": "e4defrag - online defragmenter for ext4 file system\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "e4defrag [ -c ] [ -v ] target ...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "e4defrag reduces fragmentation of extent based file. The file targeted by e4defrag is created\non ext4 file system made with \"-O extent\" option (see mke2fs(8)).   The  targeted  file  gets\nmore contiguous blocks and improves the file access speed.\n\ntarget  is  a regular file, a directory, or a device that is mounted as ext4 file system.  If\ntarget is a directory, e4defrag reduces fragmentation of all files in it. If target is a  de‐\nvice,  e4defrag  gets  the  mount  point of it and reduces fragmentation of all files in this\nmount point.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-c",
                    "content": "fragmentation  score  based on them. By seeing this score, we can determine whether we\nshould execute e4defrag to target.  When used with -v option, the  current  fragmenta‐\ntion count and the ideal fragmentation count are printed for each file.\n\nAlso  this  option  outputs the average data size in one extent. If you see it, you'll\nfind the file has ideal extents or not. Note that the maximum extent size is  131072KB\nin ext4 file system (if block size is 4KB).\n\nIf this option is specified, target is never defragmented.\n",
                    "flag": "-c"
                },
                {
                    "name": "-v",
                    "content": "file.\n",
                    "flag": "-v"
                }
            ]
        },
        "NOTES": {
            "content": "e4defrag does not support swap file, files in lost+found directory, and  files  allocated  in\nindirect  blocks. When target is a device or a mount point, e4defrag doesn't defragment files\nin mount point of other device.\n\nIt is safe to run e4defrag on a file while it is actively  in  use  by  another  application.\nSince  the contents of file blocks are copied using the page cache, this can result in a per‐\nformance slowdown to both e4defrag and the application due to contention  over  the  system's\nmemory and disk bandwidth.\n\nIf  the file system's free space is fragmented, or if there is insufficient free space avail‐\nable, e4defrag may not be able to improve the file's fragmentation.\n\nNon-privileged users can execute e4defrag to their own file, but the score is not printed  if",
            "subsections": [
                {
                    "name": "-c",
                    "content": "",
                    "flag": "-c"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Akira Fujita <a-fujita@rs.jp.nec.com> and Takashi Sato <t-sato@yk.jp.nec.com>.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "mke2fs(8), mount(8).\n\n\n\n\ne4defrag version 2.0                          May 2009                                   E4DEFRAG(8)",
            "subsections": []
        }
    },
    "summary": "e4defrag - online defragmenter for ext4 file system",
    "flags": [
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "file."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "mke2fs",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/mke2fs/8/json"
        },
        {
            "name": "mount",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/mount/8/json"
        }
    ]
}