{
    "content": [
        {
            "type": "text",
            "text": "# xfs_fsr(8) (man)\n\n**Summary:** xfsfsr - filesystem reorganizer for XFS\n\n**Synopsis:** xfsfsr [-vdg] [-t seconds] [-p passes] [-f leftoff] [-m mtab]\nxfsfsr [-vdg] [xfsdev | file] ...\nxfsfsr -V\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -m | — | — | /etc/mtab. |\n| -t | — | — |  |\n| -p | — | — |  |\n| -f | — | — | and as the file to store the state of where reorganization left off. |\n| -v | — | — |  |\n| -d | — | — |  |\n| -g | — | — |  |\n| -V | — | — | When invoked with no arguments xfsfsr reorganizes all regular files in all mounted filesys‐ tems. xfsfsr makes many cycl |\n\n## See Also\n\n- xfsfsr(8)\n- mkfs.xfs(8)\n- xfsncheck(8)\n- xfs(5)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (4 lines)\n- **DESCRIPTION** (9 lines) — 8 subsections\n  - -m (2 lines)\n  - -t (1 lines)\n  - -p (1 lines)\n  - -f (2 lines)\n  - -v (1 lines)\n  - -d (1 lines)\n  - -g (1 lines)\n  - -V (18 lines)\n- **FILES** (4 lines)\n- **SEE ALSO** (2 lines)\n- **NOTES** (34 lines)\n\n## Full Content\n\n### NAME\n\nxfsfsr - filesystem reorganizer for XFS\n\n### SYNOPSIS\n\nxfsfsr [-vdg] [-t seconds] [-p passes] [-f leftoff] [-m mtab]\nxfsfsr [-vdg] [xfsdev | file] ...\nxfsfsr -V\n\n### DESCRIPTION\n\nxfsfsr is applicable only to XFS filesystems.\n\nxfsfsr improves the organization of mounted filesystems.  The reorganization algorithm oper‐\nates on one file at a time, compacting or otherwise improving the layout of the file  extents\n(contiguous blocks of file data).\n\nThe following options are accepted by xfsfsr.  The -m, -t, and -f options have no meaning if\nany filesystems or files are specified on the command line.\n\n#### -m\n\n/etc/mtab.\n\n#### -t\n\n#### -p\n\n#### -f\n\nand as the file to store the state of where reorganization left off.\n\n#### -v\n\n#### -d\n\n#### -g\n\n#### -V\n\nWhen invoked with no arguments xfsfsr reorganizes all regular files in all mounted  filesys‐\ntems.   xfsfsr makes many cycles over /etc/mtab each time making a single pass over each XFS\nfilesystem.  Each pass goes through and selects files that have the  largest  number  of  ex‐\ntents.  It attempts to defragment the top 10% of these files on each pass.\n\nIt  runs  for  up to two hours after which it records the filesystem where it left off, so it\ncan start there the next time.  This information is stored in the file /var/tmp/.fsrlastxfs.\nIf  the information found here is somehow inconsistent or out of date it is ignored and reor‐\nganization starts at the beginning of the first filesystem found in /etc/mtab.\n\nxfsfsr can be called with one or more arguments naming filesystems (block device name),  and\nfiles  to  reorganize.  In this mode xfsfsr does not read or write /var/tmp/.fsrlastxfs nor\ndoes it run for a fixed time interval.  It makes one pass through each specified regular file\nand  all regular files in each specified filesystem.  A command line name referring to a sym‐\nbolic link (except to a file system device), FIFO, or UNIX domain socket generates a  warning\nmessage,  but is otherwise ignored.  While traversing the filesystem these types of files are\nsilently skipped.\n\n### FILES\n\n/etc/mtab            contains default list of filesystems to reorganize.\n/var/tmp/.fsrlastxfs\nrecords the state where reorganization left off.\n\n### SEE ALSO\n\nxfsfsr(8), mkfs.xfs(8), xfsncheck(8), xfs(5).\n\n### NOTES\n\nxfsfsr improves the layout of extents for each file by copying the entire file to  a  tempo‐\nrary location and then interchanging the data extents of the target and temporary files in an\natomic manner.  This method requires that enough free disk space be  available  to  copy  any\ngiven  file  and  that the space be less fragmented than the original file.  It also requires\nthe owner of the file to have enough remaining filespace quota to do the copy on systems run‐\nning  quotas.   xfsfsr generates a warning message if space is not sufficient to improve the\ntarget file.\n\nA temporary file used in improving a file given on the command line is created  in  the  same\nparent  directory  of  the  target  file and is prefixed by the string '.fsr'.  The temporary\nfiles used in improving an entire XFS device are stored in a directory at  the  root  of  the\ntarget device and use the same naming scheme.  The temporary files are unlinked upon creation\nso data will not be readable by any other process.\n\nxfsfsr does not operate on files that are currently mapped in memory.  A 'file  busy'  error\ncan be seen for these files if the verbose flag (-v) is set.\n\nFiles  marked as no-defrag will be skipped. The xfsio(8) chattr command with the f attribute\ncan be used to set or clear this flag. Files and directories created in a directory with  the\nno-defrag flag will inherit the attribute.\n\nAn entry in /etc/mtab or the file specified using the -m option must have the rw option spec‐\nified for read and write access.  If this option is  not  present,  then  xfsfsr  skips  the\nfilesystem described by that line.  See the fstab(5) reference page for more details.\n\nIn  general  we  do not foresee the need to run xfsfsr on system partitions such as /, /boot\nand /usr as in general these will not suffer from fragmentation.  There are also issues  with\ndefragmenting  files  lilo(8)  uses  to  boot your system. It is recommended that these files\nshould be flagged as no-defrag with the xfsio(8) chattr command. Should these files be moved\nby xfsfsr then you must rerun lilo before you reboot or you may have an unbootable system.\n\n\n\nxfsfsr(8)\n\n"
        }
    ],
    "structuredContent": {
        "command": "xfs_fsr",
        "section": "8",
        "mode": "man",
        "summary": "xfsfsr - filesystem reorganizer for XFS",
        "synopsis": "xfsfsr [-vdg] [-t seconds] [-p passes] [-f leftoff] [-m mtab]\nxfsfsr [-vdg] [xfsdev | file] ...\nxfsfsr -V",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-m",
                "long": null,
                "arg": null,
                "description": "/etc/mtab."
            },
            {
                "flag": "-t",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-p",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-f",
                "long": null,
                "arg": null,
                "description": "and as the file to store the state of where reorganization left off."
            },
            {
                "flag": "-v",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-g",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-V",
                "long": null,
                "arg": null,
                "description": "When invoked with no arguments xfsfsr reorganizes all regular files in all mounted filesys‐ tems. xfsfsr makes many cycles over /etc/mtab each time making a single pass over each XFS filesystem. Each pass goes through and selects files that have the largest number of ex‐ tents. It attempts to defragment the top 10% of these files on each pass. It runs for up to two hours after which it records the filesystem where it left off, so it can start there the next time. This information is stored in the file /var/tmp/.fsrlastxfs. If the information found here is somehow inconsistent or out of date it is ignored and reor‐ ganization starts at the beginning of the first filesystem found in /etc/mtab. xfsfsr can be called with one or more arguments naming filesystems (block device name), and files to reorganize. In this mode xfsfsr does not read or write /var/tmp/.fsrlastxfs nor does it run for a fixed time interval. It makes one pass through each specified regular file and all regular files in each specified filesystem. A command line name referring to a sym‐ bolic link (except to a file system device), FIFO, or UNIX domain socket generates a warning message, but is otherwise ignored. While traversing the filesystem these types of files are silently skipped."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "xfsfsr",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/xfsfsr/8/json"
            },
            {
                "name": "mkfs.xfs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mkfs.xfs/8/json"
            },
            {
                "name": "xfsncheck",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/xfsncheck/8/json"
            },
            {
                "name": "xfs",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/xfs/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": [
                    {
                        "name": "-m",
                        "lines": 2,
                        "flag": "-m"
                    },
                    {
                        "name": "-t",
                        "lines": 1,
                        "flag": "-t"
                    },
                    {
                        "name": "-p",
                        "lines": 1,
                        "flag": "-p"
                    },
                    {
                        "name": "-f",
                        "lines": 2,
                        "flag": "-f"
                    },
                    {
                        "name": "-v",
                        "lines": 1,
                        "flag": "-v"
                    },
                    {
                        "name": "-d",
                        "lines": 1,
                        "flag": "-d"
                    },
                    {
                        "name": "-g",
                        "lines": 1,
                        "flag": "-g"
                    },
                    {
                        "name": "-V",
                        "lines": 18,
                        "flag": "-V"
                    }
                ]
            },
            {
                "name": "FILES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 34,
                "subsections": []
            }
        ]
    }
}