{
    "mode": "man",
    "parameter": "xfs_io",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/xfs_io/8/json",
    "generated": "2026-05-30T07:10:29Z",
    "synopsis": "xfsio [ -adfimrRstxT ] [ -c cmd ] ... [ -C cmd ] ... [ -p prog ] [ file ]\nxfsio -V",
    "sections": {
        "NAME": {
            "content": "xfsio - debug the I/O path of an XFS filesystem\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "xfsio [ -adfimrRstxT ] [ -c cmd ] ... [ -C cmd ] ... [ -p prog ] [ file ]\nxfsio -V\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "xfsio  is  a  debugging  tool like xfsdb(8), but is aimed at examining the regular file I/O\npaths rather than the raw XFS volume itself.  These code paths include not only  the  obvious\nread/write/mmap  interfaces  for manipulating files, but also cover all of the XFS extensions\n(such as space preallocation, additional inode flags, etc).\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "xfsio commands may be run interactively (the default) or as arguments on the  command  line.\nInteractive  mode always runs commands on the current open file, whilst commands run from the\ncommand line may be repeated on all open files rather than just the current  open  file.   In\ngeneral,  open  file iteration will occur for commands that operate on file content or state.\nIn contrast, commands that operate on filesystem or system-wide state will only be run on the\ncurrent  file  regardless  of  how  many files are currently open.  Multiple arguments may be\ngiven on the command line and they are run in the sequence given. The program exits  one  all\ncommands have been run.\n",
            "subsections": [
                {
                    "name": "-c",
                    "content": "with historical usage, commands that can not be run on all open files will still be\nrun  but  only execute once on the current open file.  Multiple -c arguments may be\ngiven and may be interleaved on the command line in any order with -C commands.\n",
                    "flag": "-c"
                },
                {
                    "name": "-C -C",
                    "content": "be given and may be interleaved on the command line in any order with -c commands.\n",
                    "flag": "-C"
                },
                {
                    "name": "-p",
                    "content": "xfsio.\n",
                    "flag": "-p"
                },
                {
                    "name": "-f",
                    "content": "",
                    "flag": "-f"
                },
                {
                    "name": "-r",
                    "content": "only.\n",
                    "flag": "-r"
                },
                {
                    "name": "-i",
                    "content": "threaded process. With single threaded process, the file table is  not  shared  and\nfile structs are not reference counted.  Spawning an idle thread can help detecting\nfile struct reference leaks.\n",
                    "flag": "-i"
                },
                {
                    "name": "-x",
                    "content": "also tend to require additional privileges.\n",
                    "flag": "-x"
                },
                {
                    "name": "-V",
                    "content": "The other open(2) options described below are also available from the command line.\n",
                    "flag": "-V"
                }
            ]
        },
        "CONCEPTS": {
            "content": "xfsio  maintains  a number of open files and memory mappings.  Files can be initially opened\non the command line (optionally), and additional files can also be opened later.\n\nxfsio commands can be broken up into three groups.  Some commands are aimed at doing regular\nfile I/O - read, write, sync, space preallocation, etc.\n\nThe  second set of commands exist for manipulating memory mapped regions of a file - mapping,\naccessing, storing, unmapping, flushing, etc.\n\nThe remaining commands are for the navigation and display of data structures relating to  the\nopen files, mappings, and the filesystems where they reside.\n\nMany  commands  have extensive online help. Use the help command for more details on any com‐\nmand.\n",
            "subsections": []
        },
        "FILE I/O COMMANDS": {
            "content": "file [ N ]\nDisplay a list of all open files and (optionally) switch to an alternate current  open\nfile.\n\nopen [[ -acdfrstRTPL ] path ]\nCloses the current file, and opens the file specified by path instead. Without any ar‐\nguments, displays statistics about the current file - see the stat command.\n-a  opens append-only (OAPPEND).\n-d  opens for direct I/O (ODIRECT).\n-f  creates the file if it doesn't already exist (OCREAT).\n-r  opens read-only (ORDONLY).\n-s  opens for synchronous I/O (OSYNC).\n-t  truncates on open (OTRUNC).\n-n  opens in non-blocking mode if possible (ONONBLOCK).\n-T  create a temporary file not linked into the filesystem  namespace  (OTMPFILE).\nThe  pathname passed must refer to a directory which is treated as virtual par‐\nent for the newly created invisible file.  Can not be used together with the -r\noption.\n-R  marks  the  file  as a realtime XFS file after opening it, if it is not already\nmarked as such.\n-P  opens the path as a referent only (OPATH).  This is  incompatible  with  other\nflags specifying other Oxxx flags apart from -L.\n-L  doesn't  follow  symlinks  (ONOFOLLOW).  This is incompatible with other flags\nspecifying other Oxxx flags apart from -P.\n\no      See the open command.\n\nclose  Closes the current open file, marking the next open file as current (if one exists).\n\nc      See the close command.\n",
            "subsections": [
                {
                    "name": "chmod -r | -w",
                    "content": "Change the mode of the currently open file. The -r option will set  the  file  permis‐\nsions to read-only (0444), whilst the -w option will set the file permissions to read-\nwrite (0644). This allows xfsio to set up mismatches between the file permissions and\nthe  open file descriptor read/write mode to exercise permission checks inside various\nsyscalls.\n\npread [ -b bsize ] [ -qv ] [ -FBR [ -Z seed ] ] [ -V vectors ] offset length\nReads a range of bytes in a specified blocksize from the given offset.\n-b  can be used to set the blocksize into which the read(2) requests will be split.\nThe default blocksize is 4096 bytes.\n-q  quiet mode, do not write anything to standard output.\n-v  dump  the  contents  of  the buffer after reading, by default only the count of\nbytes actually read is dumped.\n-F  read the buffers in a forward sequential direction.\n-B  read the buffers in a reverse sequential direction.\n-R  read the buffers in the give range in a random order.\n-Z seed\nspecify the random number seed used for random reads.\n-V vectors\nUse the vectored IO read syscall preadv(2) with a number  of  blocksize  length\niovecs. The number of iovecs is set by the vectors parameter.\n\nr      See the pread command.\n\npwrite [ -i file ] [ -qdDwNOW ] [ -s skip ] [ -b size ] [ -S seed ] [ -FBR [ -Z zeed ] ] [ -V\nvectors ] offset length\nWrites a range of bytes in a specified blocksize from the  given  offset.   The  bytes\nwritten can be either a set pattern or read in from another file before writing.\n-i  allows an input file to be specified as the source of the data to be written.\n-q  quiet mode, do not write anything to standard output.\n-d  causes  direct I/O, rather than the usual buffered I/O, to be used when reading\nthe input file.\n-w  call fdatasync(2) once all writes are complete (included in timing results)\n-N  Perform the pwritev2(2) call with RWFNOWAIT.\n-D  Perform the pwritev2(2) call with RWFDSYNC.\n-O  perform pwrite once and return the (maybe partial) bytes written.\n-W  call fsync(2) once all writes are complete (included in timing results)\n-s  specifies the number of bytes to skip from the start of the input  file  before\nstarting to read.\n-b  used  to  set the blocksize into which the write(2) requests will be split. The\ndefault blocksize is 4096 bytes.\n-S  used to set the (repeated) fill pattern which is used when the data to write is\nnot coming from a file.  The default buffer fill pattern value is 0xcdcdcdcd.\n-F  write the buffers in a forward sequential direction.\n-B  write the buffers in a reverse sequential direction.\n-R  write the buffers in the give range in a random order.\n-Z seed\nspecify the random number seed used for random write\n-V vectors\nUse  the vectored IO write syscall pwritev(2) with a number of blocksize length\niovecs. The number of iovecs is set by the vectors parameter.\n\nw      See the pwrite command.\n\nbmap [ -adelpv ] [ -n nx ]\nPrints the block mapping for the current open file. Refer to  the  xfsbmap(8)  manual\npage for complete documentation.\n\nfiemap [ -alv ] [ -n nx ] [ offset [ len ]]\nPrints  the  block  mapping for the current open file using the fiemap ioctl.  Options\nbehave as described in the xfsbmap(8) manual page.\n\nOptionally, this command also supports passing the start offset from  where  to  begin\nthe  mapping  and  the length of that region.  The kernel will return any full extents\nwhich intersect with the requested range, and the fiemap command will  print  them  in\ntheir  entirety.   If  the requested range starts or ends in a hole, fiemap will print\nthe hole, truncated to the requested range.\n\nextsize [ -R | -D ] [ value ]\nDisplay and/or modify the preferred extent size used when  allocating  space  for  the\ncurrently  open  file. If the -R option is specified, a recursive descent is performed\nfor all directory entries below the currently open file (-D can be  used  to  restrict\nthe  output  to directories only).  If the target file is a directory, then the inher‐\nited extent size is set for that directory (new files created in  that  directory  in‐\nherit  that extent size).  The value should be specified in bytes, or using one of the\nusual units suffixes (k, m, g, b, etc). The extent size is always reported in units of\nbytes.\n\ncowextsize [ -R | -D ] [ value ]\nDisplay  and/or  modify  the  preferred copy-on-write extent size used when allocating\nspace for the currently open file. If the -R option is specified, a recursive  descent\nis  performed  for all directory entries below the currently open file (-D can be used\nto restrict the output to directories only).  If the target file is a directory,  then\nthe inherited CoW extent size is set for that directory (new files created in that di‐\nrectory inherit that CoW extent size).  The value should be specified in bytes, or us‐\ning  one  of the usual units suffixes (k, m, g, b, etc). The extent size is always re‐\nported in units of bytes.\n\nallocsp size 0\nSets the size of the file to size and zeroes any additional space allocated using  the\nXFSIOCALLOCSP/XFSIOCFREESP  system  call  described  in the xfsctl(3) manual page.\nallocsp and freesp do exactly the same thing.\n\nfreesp size 0\nSee the allocsp command.\n\nfadvise [ -r | -s | [[ -d | -n | -w ] offset length ]]\nOn platforms which support it, allows hints be given to the system regarding  the  ex‐\npected I/O patterns on the file.  The range arguments are required by some advise com‐\nmands ([*] below), and the others must have no range arguments.   With  no  arguments,\nthe POSIXFADVNORMAL advice is implied (default readahead).\n-d  the  data  will  not  be  accessed  again  in the near future (POSIXFADVDONT‐\nNEED[*]).\n-n  data will be accessed once and not be reused (POSIXFADVNOREUSE[*]).\n-r  expect access to data in random order (POSIXFADVRANDOM), which sets readahead\nto zero.\n-s  expect  access  to data in sequential order (POSIXFADVSEQUENTIAL), which dou‐\nbles the default readahead on the file.\n-w  advises the specified data will be needed again (POSIXFADVWILLNEED[*])  which\nforces the maximum readahead.\n"
                },
                {
                    "name": "fdatasync",
                    "content": "Calls fdatasync(2) to flush the file's in-core data to disk.\n\nfsync  Calls fsync(2) to flush all in-core file state to disk.\n\ns      See the fsync command.\n\nsyncrange [ -a | -b | -w ] offset length\nOn  platforms which support it, allows control of syncing a range of the file to disk.\nWith no options, SYNCFILERANGEWRITE is implied on the range supplied.\n-a  wait   for   IO   in   the   given    range    to    finish    after    writing\n(SYNCFILERANGEWAITAFTER).\n-b  wait    for    IO    in    the   given   range   to   finish   before   writing\n(SYNCFILERANGEWAITBEFORE).\n-w  start writeback of dirty data in the given range (SYNCFILERANGEWRITE).\n\nsync   Calls sync(2) to flush all filesystems' in-core data to disk.\n\nsyncfs Calls syncfs(2) to flush this filesystem's in-core data to disk.\n\nresvsp offset length\nAllocates reserved, unwritten space for part of a file using the XFSIOCRESVSP system\ncall described in the xfsctl(3) manual page.\n\nunresvsp offset length\nFrees  reserved  space  for  part of a file using the XFSIOCUNRESVSP system call de‐\nscribed in the xfsctl(3) manual page.\n\nfalloc [ -k ] offset length\nAllocates reserved, unwritten space for part of a file using the fallocate routine  as\ndescribed in the fallocate(2) manual page.\n-k  will set the FALLOCFLKEEPSIZE flag as described in fallocate(2).\n\nfcollapse offset length\nCall  fallocate  with  FALLOCFLCOLLAPSERANGE  flag as described in the fallocate(2)\nmanual page to de-allocates blocks and eliminates the hole created in this process  by\nshifting data blocks into the hole.\n\nfinsert offset length\nCall  fallocate with FALLOCFLINSERTRANGE flag as described in the fallocate(2) man‐\nual page to create the hole by shifting data blocks.\n\nfpunch offset length\nPunches (de-allocates)  blocks  in  the  file  by  calling  fallocate  with  the  FAL‐\nLOCFLPUNCHHOLE flag as described in the fallocate(2) manual page.\n\nfunshare offset length\nCall fallocate with FALLOCFLUNSHARERANGE flag as described in the fallocate(2) man‐\nual page to unshare all shared blocks within the range.\n\nfzero [ -k ] offset length\nCall fallocate with FALLOCFLZERORANGE flag as described in the fallocate(2)  manual\npage  to  allocate and zero blocks within the range.  With the -k option, use the FAL‐\nLOCFLKEEPSIZE flag as well.\n\nzero offset length\nCall xfsctl with XFSIOCZERORANGE as described in the xfsctl(3) manual page to allo‐\ncate and zero blocks within the range.\n\ntruncate offset\nTruncates the current file at the given offset using ftruncate(2).\n\nsendfile [ -q ] -i srcfile | -f N [ offset length ]\nOn  platforms  which  support  it, allows a direct in-kernel copy between two file de‐\nscriptors. The current open file is the target, the source must be  specified  as  an‐\nother open file (-f) or by path (-i).\n-q quiet mode, do not write anything to standard output.\n\nreaddir [ -v ] [ -o offset ] [ -l length ]\nRead a range of directory entries from a given offset of a directory.\n-v  verbose mode - dump dirent content as defined in readdir(3)\n-o  specify starting offset\n-l  specify total length to read (in bytes)\n"
                },
                {
                    "name": "seek  -a | -d | -h [ -r ] [ -s ] offset",
                    "content": "On  platforms  that  support the lseek(2) SEEKDATA and SEEKHOLE options, display the\noffsets of the specified segments.\n-a  Display both data and hole segments starting at the specified offset.\n-d  Display the data segment starting at the specified offset.\n-h  Display the hole segment starting at the specified offset.\n-r  Recursively display all the specified segments starting at the  specified  off‐‐\nset.\n-s  Display  the  starting  lseek(2) offset. This offset will be a calculated value\nwhen both data and holes are displayed together or performing a recusively dis‐\nplay.\n\nreflink  [ -C ] [ -q ] srcfile [srcoffset dstoffset length]\nOn  filesystems  that  support  the  FICLONERANGE or BTRFSIOCCLONERANGE ioctls, map\nlength bytes at offset dstoffset in the open file to the same  physical  blocks  that\nare mapped at offset srcoffset in the file srcfile , replacing any contents that may\nalready have been there.  If a program writes into a reflinked block range  of  either\nfile,  the  dirty blocks will be cloned, written to, and remapped (\"copy on write\") in\nthe affected file, leaving the other file(s) unchanged.   If  srcoffset,  dstoffset,\nand length are omitted, all contents of srcfile will be reflinked into the open file.\n-C  Print timing statistics in a condensed format.\n-q  Do not print timing statistics at all.\n\ndedupe  [ -C ] [ -q ] srcfile srcoffset dstoffset length\nOn  filesystems  that  support the FIDEDUPERANGE or BTRFSIOCFILEEXTENTSAME ioctls,\nmap length bytes at offset dstoffset in the open file to  the  same  physical  blocks\nthat  are  mapped at offset srcoffset in the file srcfile , but only if the contents\nof both ranges are identical.  This is known as block-based deduplication.  If a  pro‐\ngram  writes  into  a  reflinked  block range of either file, the dirty blocks will be\ncloned, written to, and remapped (\"copy on write\") in the affected file,  leaving  the\nother file(s) unchanged.\n-C  Print timing statistics in a condensed format.\n-q  Do not print timing statistics at all.\n\ncopyrange [ -s srcoffset ] [ -d dstoffset ] [ -l length ] srcfile | -f N\nOn  filesystems  that support the copyfilerange(2) system call, copies data from the\nsource file into the current open file.  The source must be specified either  by  path\n(srcfile)  or  as  another  open file (-f).  If length is not specified, this command\ncopies data from srcoffset to the end of srcfile into the dstfile at dstoffset.\n-s  Copy data from srcfile beginning from srcoffset.\n-d  Copy data into the open file beginning at dstoffset.\n-l  Copy up to length bytes of data.\n\nswapext donorfile\nSwaps extent forks between files. The current open file is the target. The donor  file\nis  specified  by path. Note that file data is not copied (file content moves with the\nfork(s)).\n\nsetencpolicy [ -c mode ] [ -n mode ] [ -f flags ] [ -v version ] [ keyspec ]\nOn filesystems that support encryption, assign an encryption  policy  to  the  current\nfile.   keyspec is a hex string which specifies the encryption key to use.  For v1 en‐\ncryption policies, keyspec must be a 16-character hex string (8 bytes).  For v2  poli‐\ncies,  keyspec  must be a 32-character hex string (16 bytes).  If unspecified, an all-\nzeroes value is used.\n-c mode\ncontents encryption mode (e.g. AES-256-XTS)\n-n mode\nfilenames encryption mode (e.g. AES-256-CTS)\n-f flags\npolicy flags (numeric)\n-v version\npolicy version.  Defaults to 1 or 2 depending on the length of keyspec; or to 1\nif keyspec is unspecified.\n\ngetencpolicy [ -1 ] [ -t ]\nOn  filesystems  that support encryption, display the encryption policy of the current\nfile.\n-1  Use only the old ioctl to get the encryption policy.  This only  works  if  the\nfile has a v1 encryption policy.\n-t  Test whether v2 encryption policies are supported.  Prints \"supported\", \"unsup‐\nported\", or an error message.\n\naddenckey [ -d descriptor ] [ -k keyid ]\nOn filesystems that support encryption, add an encryption key to the  filesystem  con‐\ntaining  the  currently  open  file.   By default, the raw key in binary (typically 64\nbytes long) is read from standard input.\n-d descriptor\nkey descriptor, as a 16-character hex string (8 bytes).  If given, the key will\nbe  available for use by v1 encryption policies that use this descriptor.  Oth‐\nerwise, the key is added as a v2 policy key, and on success the resulting  \"key\nidentifier\" will be printed.\n-k keyid\nID of kernel keyring key of type \"fscrypt-provisioning\".  If given, the raw key\nwill be taken from here rather than from standard input.\n\nrmenckey [ -a ] keyspec\nOn filesystems that support encryption, remove an encryption key from  the  filesystem\ncontaining the currently open file.  keyspec is a hex string specifying the key to re‐\nmove, as a 16-character \"key descriptor\" or a 32-character \"key identifier\".\n-a  Remove the key for all users who have added it,  not  just  the  current  user.\nThis is a privileged operation.\n\nenckeystatus keyspec\nOn  filesystems  that  support  encryption,  display  the status of an encryption key.\nkeyspec is a hex string specifying the key for which  to  display  the  status,  as  a\n16-character \"key descriptor\" or a 32-character \"key identifier\".\n\nlsattr [ -R | -D | -a | -v ]\nList extended inode flags on the currently open file. If the -R option is specified, a\nrecursive descent is performed for all directory entries below the currently open file\n(-D  can  be  used to restrict the output to directories only).  This is a depth first\ndescent, it does not follow symlinks and it also does not cross mount points.\n\nThe  current  inode  flag  letters  are  documented  below.   Please  refer   to   the\nioctlxfsfsgetxattr(2) documentation for more details about what they mean.\n\nr    realtime file (XFSXFLAGREALTIME)\n\np    prealloc (XFSXFLAGPREALLOC)\n\ni    immutable (XFSXFLAGIMMUTABLE)\n\na    append only (XFSXFLAGAPPEND)\n\ns    synchronous file writes (XFSXFLAGSYNC)\n\nA    noatime (XFSXFLAGNOATIME)\n\nd    nodump (XFSXFLAGNODUMP)\n\nt    inherit realtime flag (XFSXFLAGRTINHERIT)\"\n\nP    inherit project id (XFSXFLAGPROJINHERIT)\n\nn    no symlink creation (XFSXFLAGNOSYMLINKS)\n\ne    extent size hint (XFSXFLAGEXTSIZE)\n\nE    inherit extent size hint (XFSXFLAGEXTSZINHERIT)\n\nf    nodefrag (XFSXFLAGNODEFRAG)\n\nS    filestream allocator (XFSXFLAGFILESTREAM)\n\nx    direct access persistent memory (XFSXFLAGDAX)\n\nC    copy on write extent hint (XFSXFLAGCOWEXTSIZE)\n\nX    has extended attributes (XFSXFLAGHASATTR)\n\nchattr [ -R | -D ] [ +/-riasAdtPneEfSxC ]\nChange extended inode flags on the currently open file. The -R and -D options have the\nsame meaning as above.\n\nSee the lsattr command above for the list of inode flag letters.\n\nflink path\nLink the currently open file descriptor into the filesystem namespace.\nstat [ -v|-r ]\nSelected statistics from stat(2) and the XFSIOCGETXATTR system call on  the  current\nfile. If the -v option is specified, the atime (last access), mtime (last modify), and\nctime (last change) timestamps are also displayed.  The -r  option  dumps  raw  fields\nfrom the stat structure.\nstatx [ -v|-r ][ -m basic | -m all | -m <mask> ][ -FD ]\nSelected  statistics  from stat(2) and the XFSIOCGETXATTR system call on the current\nfile.\n-v  Show timestamps.\n-r  Dump raw statx structure values.\n-m basic\nSet the field mask for the statx call to STATXBASICSTATS.\n-m all\nSet the the field mask for the statx call to STATXALL (default).\n-m <mask>\nSpecify a numeric field mask for the statx call.\n-F  Force the attributes to be synced with the server.\n-D  Don't sync attributes with the server.\n\nchproj [ -R|-D ]\nModifies the project identifier associated with the current path. The -R  option  will\nrecursively descend if the current path is a directory. The -D option will also recur‐\nsively  descend,  only  setting  modifying  projects  on  subdirectories.    See   the\nxfsquota(8) manual page for more information about project identifiers.\n\nlsproj [ -R|-D ]\nDisplays  the  project  identifier associated with the current path. The -R and -D op‐\ntions behave as described above, in chproj.\n\nparent [ -cpv ]\nBy default this command prints out the parent inode numbers, inode generation  numbers\nand basenames of all the hardlinks which point to the inode of the current file.\n-p  the  output  is similar to the default output except pathnames up to the mount-\npoint are printed out instead of the component name.\n-c  the file's filesystem will check all the parent attributes for consistency.\n-v  verbose output will be printed.\n[NOTE: Not currently operational on Linux.]\n\nutimes atimesec atimensec mtimesec mtimensec\nThe utimes command changes the atime and mtime of the current  file.   sec  uses  UNIX\ntimestamp  notation and is the seconds elapsed since 1970-01-01 00:00:00 UTC.  nsec is\nthe nanoseconds since the sec. This value needs to be in the  range  0-999999999  with\nUTIMENOW and UTIMEOMIT being exceptions.  Each (sec, nsec) pair constitutes a single\ntimestamp value.\n\n\n"
                }
            ]
        },
        "MEMORY MAPPED I/O COMMANDS": {
            "content": "mmap [ N | [[ -rwxS ] [-s size ] offset length ]]\nWith no arguments, mmap shows the current mappings. Specifying a single numeric  argu‐\nment  N sets the current mapping. If two arguments are specified (a range specified by\noffset and length), a new mapping is created spanning the range,  and  the  protection\nmode  can  be given as a combination of PROTREAD (-r), PROTWRITE (-w), and PROTEXEC\n(-x).  The mapping will be created with the MAPSHARED flag by default,  or  with  the\nLinux specific (MAPSYNC | MAPSHAREDVALIDATE) flags if -S is given.  -s size is used\nto do a mmap(size) && munmap(size) operation at first, try to reserve some  extendible\nfree  memory space, if size is bigger than length parameter. But there's not guarantee\nthat the memory after length ( up to size ) will stay free.  e.g.  \"mmap -rw  -s  8192\n1024\"  will  mmap  0 ~ 1024 bytes memory, but try to reserve 1024 ~ 8192 free space(no\nguarantee). This free space will helpful  for  \"mremap  8192\"  without  MREMAPMAYMOVE\nflag.\n\nmm     See the mmap command.\n\nmremap [ -f <newaddress> ] [ -m ] newlength\nChanges  the  current mapping size to newlength.  Whether the mapping may be moved is\ncontrolled by the flags passed; MREMAPFIXED (-f), or MREMAPMAYMOVE (-m).  newlength\nspecifies  a page-aligned address to which the mapping must be moved. It can be set to\n139946004389888, 4096k or 1g etc.\n\nmrm    See the mremap command.\n\nmunmap Unmaps the current memory mapping.\n\nmu     See the munmap command.\n\nmread [ -f | -v ] [ -r ] [ offset length ]\nAccesses a segment of the current memory mapping, optionally dumping it to  the  stan‐\ndard  output  stream (with -v or -f option) for inspection. The accesses are performed\nsequentially from the start offset by default, but can also be done from the end back‐\nwards through the mapping if the -r option in specified.  The two verbose modes differ\nonly in the relative offsets they display, the -f option is relative  to  file  start,\nwhereas -v shows offsets relative to the start of the mapping.\n\nmr     See the mread command.\n\nmwrite [ -r ] [ -S seed ] [ offset length ]\nStores  a  byte into memory for a range within a mapping.  The default stored value is\n'X', repeated to fill the range specified, but this can be changed using  the  -S  op‐\ntion.   The memory stores are performed sequentially from the start offset by default,\nbut can also be done from the end backwards through the mapping if the  -r  option  in\nspecified.\n\nmw     See the mwrite command.\n\nmsync [ -i ] [ -a | -s ] [ offset length ]\nWrites  all modified copies of pages over the specified range (or entire mapping if no\nrange specified) to their backing storage  locations.   Also,  optionally  invalidates\n(-i)  so  that  subsequent references to the pages will be obtained from their backing\nstorage locations (instead of cached copies).  The flush  can  be  done  synchronously\n(-s) or asynchronously (-a).\n\nms     See the msync command.\n\nmadvise [ -d | -r | -s | -w ] [ offset length ]\nModifies  page  cache behavior when operating on the current mapping.  The range argu‐\nments are required by some advise  commands  ([*]  below).   With  no  arguments,  the\nPOSIXMADVNORMAL advice is implied (default readahead).\n-d  the pages will not be needed (POSIXMADVDONTNEED[*]).\n-r  expect  random  page  references  (POSIXMADVRANDOM),  which sets readahead to\nzero.\n-s  expect sequential page references (POSIXMADVSEQUENTIAL),  which  doubles  the\ndefault readahead on the file.\n-w  advises the specified pages will be needed again (POSIXMADVWILLNEED[*]) which\nforces the maximum readahead.\n",
            "subsections": [
                {
                    "name": "mincore",
                    "content": "Dumps a list of pages or ranges of pages that are currently in core, for  the  current\nmemory mapping.\n\n"
                }
            ]
        },
        "FILESYSTEM COMMANDS": {
            "content": "bulkstat [ -a agno ] [ -d ] [ -e endino ] [ -n batchsize ] [ -s startino ] [ -v version\"]\nDisplay  raw  stat  information about a bunch of inodes in an XFS filesystem.  Options\nare as follows:\n-a agno\nDisplay only results from the given allocation group.  If not specified, all\nresults returned will be displayed.\n-d     Print debugging information about call results.\n-e endino\nStop  displaying  records  when  this  inode number is reached.  Defaults to\nstopping when the system call stops returning results.\n-n batchsize\nRetrieve at most this many records per call.  Defaults to 4,096.\n-s startino\nDisplay inode allocation records starting with this inode.  Defaults to  the\nfirst inode in the filesystem.  If the given inode is not allocated, results\nwill begin with the next allocated inode in the filesystem.\n-v version\nUse a particular version of the kernel interface.  Currently supported  ver‐\nsions are 1 and 5.\n\nbulkstatsingle [ -d ] [ -v version ] [ inum... | special... ]\nDisplay raw stat information about individual inodes in an XFS filesystem.  The -d and\n-v options are the same as the bulkstat command.  Arguments must be inode  numbers  or\nany of the special values:\nroot   Display information about the root directory inode.\n\nfreeze Suspend  all write I/O requests to the filesystem of the current file.  Only available\nin expert mode and requires privileges.\n\nthaw   Undo the effects of a filesystem freeze operation.  Only available in expert mode  and\nrequires privileges.\n\ninject [ tag ]\nInject  errors into a filesystem to observe filesystem behavior at specific points un‐\nder adverse conditions. Without the tag argument, displays  the  list  of  error  tags\navailable.  Only available in expert mode and requires privileges.\n\nresblks [ blocks ]\nGet  and/or  set  count of reserved filesystem blocks using the XFSIOCGETRESBLKS or\nXFSIOCSETRESBLKS system calls.  Note -- this can be useful for  exercising  out  of\nspace behavior.  Only available in expert mode and requires privileges.\n\nshutdown [ -f ]\nForce  the filesystem to shut down, preventing any further IO.  XFS and other filesys‐\ntems  implement  this  functionality,  although  implementation  details  may   differ\nslightly.  Only available in expert mode and requires privileges.\n\nBy  default,  the  filesystem will not attempt to flush completed transactions to disk\nbefore shutting down the filesystem.  This simulates a disk failure or crash.\n-f  Force the filesystem to flush all completed transactions to disk  before  shut‐\nting down, matching XFS behavior when critical corruption is encountered.\n",
            "subsections": [
                {
                    "name": "statfs [ -c ] [ -g ] [ -s ]",
                    "content": "Report  selected statistics on the filesystem where the current file resides.  The de‐\nfault behavior is to enable all three reporting options:\n-c     Display XFSIOCFSCOUNTERS summary counter data.\n-g     Display XFSIOCFSGEOMETRY filesystem geometry data.\n-s     Display statfs(2) data.\n\ninode  [ [ -n ] number ] [ -v ]\nThe inode command queries physical information about an inode. With no  arguments,  it\nwill  return  1 or 0, indicating whether or not any inode numbers greater than 32 bits\nare currently in use in the filesystem.  If given an inode number as an argument,  the\ncommand will return the same inode number if it is in use, or 0 if not. With -n number\n, the next used inode number after this number will be returned, or zero if  the  sup‐\nplied inode number is the highest one in use. With -v the command will also report the\nnumber of bits (32 or 64) used by the inode number printed in the result; if no  inode\nnumber  was  specified  on  the command line, the maximum possible inode number in the\nsystem will be printed along with its size.\n\ninumbers [ -a agno ] [ -d ] [ -e endino ] [ -n batchsize ] [ -s startino ] [ -v version ]\nPrints allocation information about groups of inodes in an  XFS  filesystem.   Callers\ncan  use  this  information  to figure out which inodes are allocated.  Options are as\nfollows:\n-a agno\nDisplay only results from the given allocation group.  If not specified, all\nresults returned will be displayed.\n-d     Print debugging information about call results.\n-e endino\nStop  displaying  records  when  this  inode number is reached.  Defaults to\nstopping when the system call stops returning results.\n-n batchsize\nRetrieve at most this many records per call.  Defaults to 4,096.\n-s startino\nDisplay inode allocation records starting with this inode.  Defaults to  the\nfirst inode in the filesystem.  If the given inode is not allocated, results\nwill begin with the next allocated inode in the filesystem.\n-v version\nUse a particular version of the kernel interface.  Currently supported  ver‐\nsions are 1 and 5.\n\nscrub type [ agnumber | ino gen ]\nScrub  internal  XFS  filesystem metadata.  The type parameter specifies which type of\nmetadata to scrub.  For AG metadata, one AG number must be specified.  For file  meta‐\ndata,  the  scrub  is  applied to the open file unless the inode number and generation\nnumber are specified.\n\nrepair type [ agnumber | ino gen ]\nRepair internal XFS filesystem metadata.  The type parameter specifies which  type  of\nmetadata to repair.  For AG metadata, one AG number must be specified.  For file meta‐\ndata, the repair is applied to the open file unless the inode  number  and  generation\nnumber are specified.\n\nlabel [ -c | -s label ]\nOn filesystems that support online label manipulation, get, set, or clear the filesys‐\ntem label.  With no options, print the current filesystem label.  The -c option clears\nthe  filesystem  label by setting it to the null string.  The -s label option sets the\nfilesystem label to label.  If the label is longer than the  filesystem  will  accept,\nxfsio  will  print an error message.  XFS filesystem labels can be at most 12 charac‐\nters long.\n\nfsmap [ -d | -l | -r ] [ -m | -v ] [ -n nx ] [ start ] [ end ]\nPrints the mapping of disk blocks used by the filesystem  hosting  the  current  file.\nThe  map lists each extent used by files, allocation group metadata, journalling logs,\nand static filesystem metadata, as well as any regions that are unused.  Each line  of\nthe listings takes the following form:\n\nextent: major:minor [startblock..endblock]: owner startoffset..endoffset length\n\nStatic  filesystem  metadata, allocation group metadata, btrees, journalling logs, and\nfree space are marked by replacing the  startoffset..endoffset  with  the  appropriate\nmarker.   All  blocks, offsets, and lengths are specified in units of 512-byte blocks,\nno matter what the filesystem's block size is.  The optional start and  end  arguments\ncan  be  used  to constrain the output to a particular range of disk blocks.  If these\ntwo options are specified, exactly one of -d, -l, or -r must also be set.\n-d     Display only extents from the data device.  This option only applies for XFS\nfilesystems.\n-l     Display only extents from the external log device.  This option only applies\nto XFS filesystems.\n-r     Display only extents from the realtime device.  This option only applies  to\nXFS filesystems.\n-m     Display results in a machine readable format (CSV).  This option is not com‐\npatible with the -v flag.  The columns of the output are: extent number, de‐\nvice major, device minor, physical start, physical end, owner, offset start,\noffset end, length.  The start, end, and  length  numbers  are  provided  in\nunits of 512b.  The owner field is a special string that takes the form:\n\ninode%llddata\nfor inode data.\ninode%llddatabmbt\nfor inode data extent maps.\ninode%lldattr\nfor inode extended attribute data.\ninode%lldattrbmbt\nfor inode extended attribute extent maps.\nspecial%u:%u\nfor other filesystem metadata.\n\n\n-n numextents\nIf this option is given, fsmap obtains the extent list of the file in groups\nof numextents extents.  In the absence of -n, fsmap queries the system  for\nextents in groups of 131,072 records.\n\n-v     Shows  verbose information.  When this flag is specified, additional AG spe‐\ncific information is appended to each line in the following form:\n\nagno (startagblock..endagblock) nblocks flags\n\nA second -v option will print out the flags legend.  This option is not com‐\npatible with the -m flag.\n\n\n"
                }
            ]
        },
        "OTHER COMMANDS": {
            "content": "help [ command ]\nDisplay a brief description of one or all commands.\n\nprint  Display a list of all open files and memory mapped regions.  The current file and cur‐\nrent mapping are distinguishable from any others.\n\np      See the print command.\n\nquit   Exit xfsio.\n\nq      See the quit command.\n\nlogwrites -d device -m mark\nCreate a mark named mark in the dm-log-writes log specified by device.   This  is  in‐\ntended to be equivalent to the shell command:\n\ndmsetup message device 0 mark mark\n\nlw     See the logwrites command.\n",
            "subsections": [
                {
                    "name": "crc32cselftest",
                    "content": "Test  the  internal  crc32c  implementation to make sure that it computes results cor‐\nrectly.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "mkfs.xfs(8), xfsctl(3), xfsbmap(8), xfsdb(8), xfs(5), fdatasync(2),  fstat(2),  fstatfs(2),\nfsync(2),  ftruncate(2),  futimens(3), mmap(2), msync(2), open(2), pread(2), pwrite(2), read‐‐\ndir(3), dmsetup(8).\n\n\n\nxfsio(8)",
            "subsections": []
        }
    },
    "summary": "xfsio - debug the I/O path of an XFS filesystem",
    "flags": [
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "with historical usage, commands that can not be run on all open files will still be run but only execute once on the current open file. Multiple -c arguments may be given and may be interleaved on the command line in any order with -C commands."
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": "be given and may be interleaved on the command line in any order with -c commands."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "xfsio."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": "only."
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": "threaded process. With single threaded process, the file table is not shared and file structs are not reference counted. Spawning an idle thread can help detecting file struct reference leaks."
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": "also tend to require additional privileges."
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": "The other open(2) options described below are also available from the command line."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "mkfs.xfs",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/mkfs.xfs/8/json"
        },
        {
            "name": "xfsctl",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/xfsctl/3/json"
        },
        {
            "name": "xfsbmap",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/xfsbmap/8/json"
        },
        {
            "name": "xfsdb",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/xfsdb/8/json"
        },
        {
            "name": "xfs",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/xfs/5/json"
        },
        {
            "name": "fdatasync",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/fdatasync/2/json"
        },
        {
            "name": "fstat",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/fstat/2/json"
        },
        {
            "name": "fstatfs",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/fstatfs/2/json"
        },
        {
            "name": "fsync",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/fsync/2/json"
        },
        {
            "name": "ftruncate",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/ftruncate/2/json"
        },
        {
            "name": "futimens",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/futimens/3/json"
        },
        {
            "name": "mmap",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/mmap/2/json"
        },
        {
            "name": "msync",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/msync/2/json"
        },
        {
            "name": "open",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/open/2/json"
        },
        {
            "name": "pread",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/pread/2/json"
        },
        {
            "name": "pwrite",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/pwrite/2/json"
        },
        {
            "name": "dir",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/dir/3/json"
        },
        {
            "name": "dmsetup",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/dmsetup/8/json"
        },
        {
            "name": "xfsio",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/xfsio/8/json"
        }
    ]
}