1xfs_io(8) System Manager's Manual xfs_io(8)
2
3
4
6 xfs_io - debug the I/O path of an XFS filesystem
7
9 xfs_io [ -adfimrRstxT ] [ -c cmd ] ... [ -C cmd ] ... [ -p prog ] [
10 file ]
11 xfs_io -V
12
14 xfs_io is a debugging tool like xfs_db(8), but is aimed at examining
15 the regular file I/O paths rather than the raw XFS volume itself.
16 These code paths include not only the obvious read/write/mmap inter‐
17 faces for manipulating files, but also cover all of the XFS extensions
18 (such as space preallocation, additional inode flags, etc).
19
21 xfs_io commands may be run interactively (the default) or as arguments
22 on the command line. Interactive mode always runs commands on the cur‐
23 rent open file, whilst commands run from the command line may be
24 repeated on all open files rather than just the current open file. In
25 general, open file iteration will occur for commands that operate on
26 file content or state. In contrast, commands that operate on filesystem
27 or system-wide state will only be run on the current file regardless of
28 how many files are currently open. Multiple arguments may be given on
29 the command line and they are run in the sequence given. The program
30 exits one all commands have been run.
31
32 -c cmd Run the specified command on all currently open files. To
33 maintain compatibility with historical usage, commands that
34 can not be run on all open files will still be run but only
35 execute once on the current open file. Multiple -c arguments
36 may be given and may be interleaved on the command line in
37 any order with -C commands.
38
39 -C cmd Run the specified command only on the current open file.
40 Multiple -C arguments may be given and may be interleaved on
41 the command line in any order with -c commands.
42
43 -p prog Set the program name for prompts and some error messages, the
44 default value is xfs_io.
45
46 -f Create file if it does not already exist.
47
48 -r Open file read-only, initially. This is required if file is
49 immutable or append-only.
50
51 -i Start an idle thread. The purpose of this idle thread is to
52 test io from a multi threaded process. With single threaded
53 process, the file table is not shared and file structs are
54 not reference counted. Spawning an idle thread can help
55 detecting file struct reference leaks.
56
57 -x Expert mode. Dangerous commands are only available in this
58 mode. These commands also tend to require additional privi‐
59 leges.
60
61 -V Prints the version number and exits.
62
63 The other open(2) options described below are also available from the
64 command line.
65
67 xfs_io maintains a number of open files and memory mappings. Files can
68 be initially opened on the command line (optionally), and additional
69 files can also be opened later.
70
71 xfs_io commands can be broken up into three groups. Some commands are
72 aimed at doing regular file I/O - read, write, sync, space prealloca‐
73 tion, etc.
74
75 The second set of commands exist for manipulating memory mapped regions
76 of a file - mapping, accessing, storing, unmapping, flushing, etc.
77
78 The remaining commands are for the navigation and display of data
79 structures relating to the open files, mappings, and the filesystems
80 where they reside.
81
82 Many commands have extensive online help. Use the help command for more
83 details on any command.
84
86 file [ N ]
87 Display a list of all open files and (optionally) switch to an
88 alternate current open file.
89
90 open [[ -acdfrstRTPL ] path ]
91 Closes the current file, and opens the file specified by path
92 instead. Without any arguments, displays statistics about the
93 current file - see the stat command.
94 -a opens append-only (O_APPEND).
95 -d opens for direct I/O (O_DIRECT).
96 -f creates the file if it doesn't already exist (O_CREAT).
97 -r opens read-only (O_RDONLY).
98 -s opens for synchronous I/O (O_SYNC).
99 -t truncates on open (O_TRUNC).
100 -n opens in non-blocking mode if possible (O_NONBLOCK).
101 -T create a temporary file not linked into the filesystem
102 namespace (O_TMPFILE). The pathname passed must refer to
103 a directory which is treated as virtual parent for the
104 newly created invisible file. Can not be used together
105 with the -r option.
106 -R marks the file as a realtime XFS file after opening it,
107 if it is not already marked as such.
108 -P opens the path as a referent only (O_PATH). This is
109 incompatible with other flags specifying other O_xxx
110 flags apart from -L.
111 -L doesn't follow symlinks (O_NOFOLLOW). This is incompati‐
112 ble with other flags specifying other O_xxx flags apart
113 from -P.
114
115 o See the open command.
116
117 close Closes the current open file, marking the next open file as cur‐
118 rent (if one exists).
119
120 c See the close command.
121
122 chmod -r | -w
123 Change the mode of the currently open file. The -r option will
124 set the file permissions to read-only (0444), whilst the -w
125 option will set the file permissions to read-write (0644). This
126 allows xfs_io to set up mismatches between the file permissions
127 and the open file descriptor read/write mode to exercise permis‐
128 sion checks inside various syscalls.
129
130 pread [ -b bsize ] [ -v ] [ -FBR [ -Z seed ] ] [ -V vectors ] offset
131 length
132 Reads a range of bytes in a specified blocksize from the given
133 offset.
134 -b can be used to set the blocksize into which the read(2)
135 requests will be split. The default blocksize is 4096
136 bytes.
137 -v dump the contents of the buffer after reading, by default
138 only the count of bytes actually read is dumped.
139 -F read the buffers in a forwards sequential direction.
140 -B read the buffers in a reserve sequential direction.
141 -R read the buffers in the give range in a random order.
142 -Z seed
143 specify the random number seed used for random reads.
144 -V vectors
145 Use the vectored IO read syscall preadv(2) with a number
146 of blocksize length iovecs. The number of iovecs is set
147 by the vectors parameter.
148
149 r See the pread command.
150
151 pwrite [ -i file ] [ -dDwNOW ] [ -s skip ] [ -b size ] [ -S seed ] [
152 -FBR [ -Z zeed ] ] [ -V vectors ] offset length
153 Writes a range of bytes in a specified blocksize from the given
154 offset. The bytes written can be either a set pattern or read
155 in from another file before writing.
156 -i allows an input file to be specified as the source of the
157 data to be written.
158 -d causes direct I/O, rather than the usual buffered I/O, to
159 be used when reading the input file.
160 -w call fdatasync(2) once all writes are complete (included
161 in timing results)
162 -N Perform the pwritev2(2) call with RWF_NOWAIT.
163 -D Perform the pwritev2(2) call with RWF_DSYNC.
164 -O perform pwrite once and return the (maybe partial) bytes
165 written.
166 -W call fsync(2) once all writes are complete (included in
167 timing results)
168 -s specifies the number of bytes to skip from the start of
169 the input file before starting to read.
170 -b used to set the blocksize into which the write(2)
171 requests will be split. The default blocksize is 4096
172 bytes.
173 -S used to set the (repeated) fill pattern which is used
174 when the data to write is not coming from a file. The
175 default buffer fill pattern value is 0xcdcdcdcd.
176 -F write the buffers in a forwards sequential direction.
177 -B write the buffers in a reserve sequential direction.
178 -R write the buffers in the give range in a random order.
179 -Z seed
180 specify the random number seed used for random write
181 -V vectors
182 Use the vectored IO write syscall pwritev(2) with a num‐
183 ber of blocksize length iovecs. The number of iovecs is
184 set by the vectors parameter.
185
186 w See the pwrite command.
187
188 bmap [ -adelpv ] [ -n nx ]
189 Prints the block mapping for the current open file. Refer to the
190 xfs_bmap(8) manual page for complete documentation.
191
192 fiemap [ -alv ] [ -n nx ] [ offset [ len ]]
193 Prints the block mapping for the current open file using the
194 fiemap ioctl. Options behave as described in the xfs_bmap(8)
195 manual page.
196
197 Optionally, this command also supports passing the start offset
198 from where to begin the mapping and the length of that region.
199 The kernel will return any full extents which intersect with the
200 requested range, and the fiemap command will print them in their
201 entirety. If the requested range starts or ends in a hole,
202 fiemap will print the hole, truncated to the requested range.
203
204 extsize [ -R | -D ] [ value ]
205 Display and/or modify the preferred extent size used when allo‐
206 cating space for the currently open file. If the -R option is
207 specified, a recursive descent is performed for all directory
208 entries below the currently open file (-D can be used to
209 restrict the output to directories only). If the target file is
210 a directory, then the inherited extent size is set for that
211 directory (new files created in that directory inherit that
212 extent size). The value should be specified in bytes, or using
213 one of the usual units suffixes (k, m, g, b, etc). The extent
214 size is always reported in units of bytes.
215
216 cowextsize [ -R | -D ] [ value ]
217 Display and/or modify the preferred copy-on-write extent size
218 used when allocating space for the currently open file. If the
219 -R option is specified, a recursive descent is performed for all
220 directory entries below the currently open file (-D can be used
221 to restrict the output to directories only). If the target file
222 is a directory, then the inherited CoW extent size is set for
223 that directory (new files created in that directory inherit that
224 CoW extent size). The value should be specified in bytes, or
225 using one of the usual units suffixes (k, m, g, b, etc). The
226 extent size is always reported in units of bytes.
227
228 allocsp size 0
229 Sets the size of the file to size and zeroes any additional
230 space allocated using the XFS_IOC_ALLOCSP/XFS_IOC_FREESP system
231 call described in the xfsctl(3) manual page. allocsp and freesp
232 do exactly the same thing.
233
234 freesp size 0
235 See the allocsp command.
236
237 fadvise [ -r | -s | [[ -d | -n | -w ] offset length ]]
238 On platforms which support it, allows hints be given to the sys‐
239 tem regarding the expected I/O patterns on the file. The range
240 arguments are required by some advise commands ([*] below), and
241 the others must have no range arguments. With no arguments, the
242 POSIX_FADV_NORMAL advice is implied (default readahead).
243 -d the data will not be accessed again in the near future
244 (POSIX_FADV_DONTNEED[*]).
245 -n data will be accessed once and not be reused
246 (POSIX_FADV_NOREUSE[*]).
247 -r expect access to data in random order (POSIX_FADV_RAN‐
248 DOM), which sets readahead to zero.
249 -s expect access to data in sequential order
250 (POSIX_FADV_SEQUENTIAL), which doubles the default reada‐
251 head on the file.
252 -w advises the specified data will be needed again
253 (POSIX_FADV_WILLNEED[*]) which forces the maximum reada‐
254 head.
255
256 fdatasync
257 Calls fdatasync(2) to flush the file's in-core data to disk.
258
259 fsync Calls fsync(2) to flush all in-core file state to disk.
260
261 s See the fsync command.
262
263 sync_range [ -a | -b | -w ] offset length
264 On platforms which support it, allows control of syncing a range
265 of the file to disk. With no options, SYNC_FILE_RANGE_WRITE is
266 implied on the range supplied.
267 -a wait for IO in the given range to finish after writing
268 (SYNC_FILE_RANGE_WAIT_AFTER).
269 -b wait for IO in the given range to finish before writing
270 (SYNC_FILE_RANGE_WAIT_BEFORE).
271 -w start writeback of dirty data in the given range
272 (SYNC_FILE_RANGE_WRITE).
273
274 sync Calls sync(2) to flush all filesystems' in-core data to disk.
275
276 syncfs Calls syncfs(2) to flush this filesystem's in-core data to disk.
277
278 resvsp offset length
279 Allocates reserved, unwritten space for part of a file using the
280 XFS_IOC_RESVSP system call described in the xfsctl(3) manual
281 page.
282
283 unresvsp offset length
284 Frees reserved space for part of a file using the
285 XFS_IOC_UNRESVSP system call described in the xfsctl(3) manual
286 page.
287
288 falloc [ -k ] offset length
289 Allocates reserved, unwritten space for part of a file using the
290 fallocate routine as described in the fallocate(2) manual page.
291 -k will set the FALLOC_FL_KEEP_SIZE flag as described in
292 fallocate(2).
293
294 fcollapse offset length
295 Call fallocate with FALLOC_FL_COLLAPSE_RANGE flag as described
296 in the fallocate(2) manual page to de-allocates blocks and elim‐
297 inates the hole created in this process by shifting data blocks
298 into the hole.
299
300 finsert offset length
301 Call fallocate with FALLOC_FL_INSERT_RANGE flag as described in
302 the fallocate(2) manual page to create the hole by shifting data
303 blocks.
304
305 fpunch offset length
306 Punches (de-allocates) blocks in the file by calling fallocate
307 with the FALLOC_FL_PUNCH_HOLE flag as described in the fallo‐
308 cate(2) manual page.
309
310 funshare offset length
311 Call fallocate with FALLOC_FL_UNSHARE_RANGE flag as described in
312 the fallocate(2) manual page to unshare all shared blocks within
313 the range.
314
315 fzero [ -k ] offset length
316 Call fallocate with FALLOC_FL_ZERO_RANGE flag as described in
317 the fallocate(2) manual page to allocate and zero blocks within
318 the range. With the -k option, use the FALLOC_FL_KEEP_SIZE flag
319 as well.
320
321 zero offset length
322 Call xfsctl with XFS_IOC_ZERO_RANGE as described in the
323 xfsctl(3) manual page to allocate and zero blocks within the
324 range.
325
326 truncate offset
327 Truncates the current file at the given offset using ftrun‐
328 cate(2).
329
330 sendfile -i srcfile | -f N [ offset length ]
331 On platforms which support it, allows a direct in-kernel copy
332 between two file descriptors. The current open file is the tar‐
333 get, the source must be specified as another open file (-f) or
334 by path (-i).
335
336 readdir [ -v ] [ -o offset ] [ -l length ]
337 Read a range of directory entries from a given offset of a
338 directory.
339 -v verbose mode - dump dirent content as defined in read‐
340 dir(3)
341 -o specify starting offset
342 -l specify total length to read (in bytes)
343
344 seek -a | -d | -h [ -r ] [ -s ] offset
345 On platforms that support the lseek(2) SEEK_DATA and SEEK_HOLE
346 options, display the offsets of the specified segments.
347 -a Display both data and hole segments starting at the spec‐
348 ified offset.
349 -d Display the data segment starting at the specified off‐
350 set.
351 -h Display the hole segment starting at the specified off‐
352 set.
353 -r Recursively display all the specified segments starting
354 at the specified offset.
355 -s Display the starting lseek(2) offset. This offset will be
356 a calculated value when both data and holes are displayed
357 together or performing a recusively display.
358
359 reflink [ -C ] [ -q ] src_file [src_offset dst_offset length]
360 On filesystems that support the FICLONERANGE or
361 BTRFS_IOC_CLONE_RANGE ioctls, map length bytes at offset
362 dst_offset in the open file to the same physical blocks that are
363 mapped at offset src_offset in the file src_file , replacing any
364 contents that may already have been there. If a program writes
365 into a reflinked block range of either file, the dirty blocks
366 will be cloned, written to, and remapped ("copy on write") in
367 the affected file, leaving the other file(s) unchanged. If
368 src_offset, dst_offset, and length are omitted, all contents of
369 src_file will be reflinked into the open file.
370 -C Print timing statistics in a condensed format.
371 -q Do not print timing statistics at all.
372
373 dedupe [ -C ] [ -q ] src_file src_offset dst_offset length
374 On filesystems that support the FIDEDUPERANGE or
375 BTRFS_IOC_FILE_EXTENT_SAME ioctls, map length bytes at offset
376 dst_offset in the open file to the same physical blocks that are
377 mapped at offset src_offset in the file src_file , but only if
378 the contents of both ranges are identical. This is known as
379 block-based deduplication. If a program writes into a reflinked
380 block range of either file, the dirty blocks will be cloned,
381 written to, and remapped ("copy on write") in the affected file,
382 leaving the other file(s) unchanged.
383 -C Print timing statistics in a condensed format.
384 -q Do not print timing statistics at all.
385
386 copy_range [ -s src_offset ] [ -d dst_offset ] [ -l length ] src_file |
387 -f N
388 On filesystems that support the copy_file_range(2) system call,
389 copies data from the source file into the current open file.
390 The source must be specified either by path (src_file) or as
391 another open file (-f). If src_file src_offset, dst_offset, and
392 length are omitted the contents of src_file will be copied to
393 the beginning of the open file, overwriting any data already
394 there.
395 -s Copy data from src_file beginning from src_offset.
396 -d Copy data into the open file beginning at dst_offset.
397 -l Copy up to length bytes of data.
398
399 swapext donor_file
400 Swaps extent forks between files. The current open file is the
401 target. The donor file is specified by path. Note that file data
402 is not copied (file content moves with the fork(s)).
403
404 set_encpolicy [ -c mode ] [ -n mode ] [ -f flags ] [ -v version ] [
405 keydesc ]
406 On filesystems that support encryption, assign an encryption
407 policy to the current file. keydesc is a 16-byte hex string
408 which identifies the encryption key to use. If not specified, a
409 "default" key descriptor of all 0's will be used.
410 -c mode
411 contents encryption mode (e.g. AES-256-XTS)
412 -n mode
413 filenames encryption mode (e.g. AES-256-CTS)
414 -f flags
415 policy flags (numeric)
416 -v version
417 version of policy structure (numeric)
418
419 get_encpolicy
420 On filesystems that support encryption, display the encryption
421 policy of the current file.
422
423
424 lsattr [ -R | -D | -a | -v ]
425 List extended inode flags on the currently open file. If the -R
426 option is specified, a recursive descent is performed for all
427 directory entries below the currently open file (-D can be used
428 to restrict the output to directories only). This is a depth
429 first descent, it does not follow symlinks and it also does not
430 cross mount points.
431
432 chattr [ -R | -D ] [ +/-riasAdtPneEfSxC ]
433 Change extended inode flags on the currently open file. The -R
434 and -D options have the same meaning as above. The mapping
435 between each letter and the inode flags (refer to xfsctl(3) for
436 the full list) is available via the help command.
437
438 flink path
439 Link the currently open file descriptor into the filesystem
440 namespace.
441
442 stat [ -v|-r ]
443 Selected statistics from stat(2) and the XFS_IOC_GETXATTR system
444 call on the current file. If the -v option is specified, the
445 atime (last access), mtime (last modify), and ctime (last
446 change) timestamps are also displayed. The -r option dumps raw
447 fields from the stat structure.
448
449 statx [ -v|-r ][ -m basic | -m all | -m <mask> ][ -FD ]
450 Selected statistics from stat(2) and the XFS_IOC_GETXATTR system
451 call on the current file.
452 -v Show timestamps.
453 -r Dump raw statx structure values.
454 -m basic
455 Set the field mask for the statx call to
456 STATX_BASIC_STATS.
457 -m all
458 Set the the field mask for the statx call to STATX_ALL
459 (default).
460 -m <mask>
461 Specify a numeric field mask for the statx call.
462 -F Force the attributes to be synced with the server.
463 -D Don't sync attributes with the server.
464
465 chproj [ -R|-D ]
466 Modifies the project identifier associated with the current
467 path. The -R option will recursively descend if the current path
468 is a directory. The -D option will also recursively descend,
469 only setting modifying projects on subdirectories. See the
470 xfs_quota(8) manual page for more information about project
471 identifiers.
472
473 lsproj [ -R|-D ]
474 Displays the project identifier associated with the current
475 path. The -R and -D options behave as described above, in
476 chproj.
477
478 parent [ -cpv ]
479 By default this command prints out the parent inode numbers,
480 inode generation numbers and basenames of all the hardlinks
481 which point to the inode of the current file.
482 -p the output is similar to the default output except path‐
483 names up to the mount-point are printed out instead of
484 the component name.
485 -c the file's filesystem will check all the parent
486 attributes for consistency.
487 -v verbose output will be printed.
488 [NOTE: Not currently operational on Linux.]
489
490 utimes atime_sec atime_nsec mtime_sec mtime_nsec
491 The utimes command changes the atime and mtime of the current
492 file. sec uses UNIX timestamp notation and is the seconds
493 elapsed since 1970-01-01 00:00:00 UTC. nsec is the nanoseconds
494 since the sec. This value needs to be in the range 0-999999999
495 with UTIME_NOW and UTIME_OMIT being exceptions. Each (sec,
496 nsec) pair constitutes a single timestamp value.
497
498
499
501 mmap [ N | [[ -rwxS ] [-s size ] offset length ]]
502 With no arguments, mmap shows the current mappings. Specifying a
503 single numeric argument N sets the current mapping. If two argu‐
504 ments are specified (a range specified by offset and length), a
505 new mapping is created spanning the range, and the protection
506 mode can be given as a combination of PROT_READ (-r), PROT_WRITE
507 (-w), and PROT_EXEC (-x). The mapping will be created with the
508 MAP_SHARED flag by default, or with the Linux specific (MAP_SYNC
509 | MAP_SHARED_VALIDATE) flags if -S is given. -s size is used to
510 do a mmap(size) && munmap(size) operation at first, try to
511 reserve some extendible free memory space, if size is bigger
512 than length parameter. But there's not guarantee that the memory
513 after length ( up to size ) will stay free. e.g. "mmap -rw -s
514 8192 1024" will mmap 0 ~ 1024 bytes memory, but try to reserve
515 1024 ~ 8192 free space(no guarantee). This free space will help‐
516 ful for "mremap 8192" without MREMAP_MAYMOVE flag.
517
518 mm See the mmap command.
519
520 mremap [ -f <new_address> ] [ -m ] new_length
521 Changes the current mapping size to new_length. Whether the
522 mapping may be moved is controlled by the flags passed;
523 MREMAP_FIXED (-f), or MREMAP_MAYMOVE (-m). new_length specifies
524 a page-aligned address to which the mapping must be moved. It
525 can be set to 139946004389888, 4096k or 1g etc.
526
527 mrm See the mremap command.
528
529 munmap Unmaps the current memory mapping.
530
531 mu See the munmap command.
532
533 mread [ -f | -v ] [ -r ] [ offset length ]
534 Accesses a segment of the current memory mapping, optionally
535 dumping it to the standard output stream (with -v or -f option)
536 for inspection. The accesses are performed sequentially from the
537 start offset by default, but can also be done from the end back‐
538 wards through the mapping if the -r option in specified. The
539 two verbose modes differ only in the relative offsets they dis‐
540 play, the -f option is relative to file start, whereas -v shows
541 offsets relative to the start of the mapping.
542
543 mr See the mread command.
544
545 mwrite [ -r ] [ -S seed ] [ offset length ]
546 Stores a byte into memory for a range within a mapping. The
547 default stored value is 'X', repeated to fill the range speci‐
548 fied, but this can be changed using the -S option. The memory
549 stores are performed sequentially from the start offset by
550 default, but can also be done from the end backwards through the
551 mapping if the -r option in specified.
552
553 mw See the mwrite command.
554
555 msync [ -i ] [ -a | -s ] [ offset length ]
556 Writes all modified copies of pages over the specified range (or
557 entire mapping if no range specified) to their backing storage
558 locations. Also, optionally invalidates (-i) so that subsequent
559 references to the pages will be obtained from their backing
560 storage locations (instead of cached copies). The flush can be
561 done synchronously (-s) or asynchronously (-a).
562
563 ms See the msync command.
564
565 madvise [ -d | -r | -s | -w ] [ offset length ]
566 Modifies page cache behavior when operating on the current map‐
567 ping. The range arguments are required by some advise commands
568 ([*] below). With no arguments, the POSIX_MADV_NORMAL advice is
569 implied (default readahead).
570 -d the pages will not be needed (POSIX_MADV_DONTNEED[*]).
571 -r expect random page references (POSIX_MADV_RANDOM), which
572 sets readahead to zero.
573 -s expect sequential page references (POSIX_MADV_SEQUEN‐
574 TIAL), which doubles the default readahead on the file.
575 -w advises the specified pages will be needed again
576 (POSIX_MADV_WILLNEED[*]) which forces the maximum reada‐
577 head.
578
579 mincore
580 Dumps a list of pages or ranges of pages that are currently in
581 core, for the current memory mapping.
582
583
585 freeze Suspend all write I/O requests to the filesystem of the current
586 file. Only available in expert mode and requires privileges.
587
588 thaw Undo the effects of a filesystem freeze operation. Only avail‐
589 able in expert mode and requires privileges.
590
591 inject [ tag ]
592 Inject errors into a filesystem to observe filesystem behavior
593 at specific points under adverse conditions. Without the tag
594 argument, displays the list of error tags available. Only
595 available in expert mode and requires privileges.
596
597 resblks [ blocks ]
598 Get and/or set count of reserved filesystem blocks using the
599 XFS_IOC_GET_RESBLKS or XFS_IOC_SET_RESBLKS system calls. Note
600 -- this can be useful for exercising out of space behavior.
601 Only available in expert mode and requires privileges.
602
603 shutdown [ -f ]
604 Force the filesystem to shut down, preventing any further IO.
605 XFS and other filesystems implement this functionality, although
606 implementation details may differ slightly. Only available in
607 expert mode and requires privileges.
608
609 By default, the filesystem will not attempt to flush completed
610 transactions to disk before shutting down the filesystem. This
611 simulates a disk failure or crash.
612 -f Force the filesystem to flush all completed transactions
613 to disk before shutting down, matching XFS behavior when
614 critical corruption is encountered.
615
616 statfs Selected statistics from statfs(2) and the XFS_IOC_FSGEOMETRY
617 system call on the filesystem where the current file resides.
618
619 inode [ [ -n ] number ] [ -v ]
620 The inode command queries physical information about an inode.
621 With no arguments, it will return 1 or 0, indicating whether or
622 not any inode numbers greater than 32 bits are currently in use
623 in the filesystem. If given an inode number as an argument, the
624 command will return the same inode number if it is in use, or 0
625 if not. With -n number , the next used inode number after this
626 number will be returned, or zero if the supplied inode number is
627 the highest one in use. With -v the command will also report the
628 number of bits (32 or 64) used by the inode number printed in
629 the result; if no inode number was specified on the command
630 line, the maximum possible inode number in the system will be
631 printed along with its size.
632
633 scrub type [ agnumber | ino gen ]
634 Scrub internal XFS filesystem metadata. The type parameter
635 specifies which type of metadata to scrub. For AG metadata, one
636 AG number must be specified. For file metadata, the scrub is
637 applied to the open file unless the inode number and generation
638 number are specified.
639
640 repair type [ agnumber | ino gen ]
641 Repair internal XFS filesystem metadata. The type parameter
642 specifies which type of metadata to repair. For AG metadata,
643 one AG number must be specified. For file metadata, the repair
644 is applied to the open file unless the inode number and genera‐
645 tion number are specified.
646
647 label [ -c | -s label ]
648 On filesystems that support online label manipulation, get, set,
649 or clear the filesystem label. With no options, print the cur‐
650 rent filesystem label. The -c option clears the filesystem
651 label by setting it to the null string. The -s label option
652 sets the filesystem label to label. If the label is longer than
653 the filesystem will accept, xfs_io will print an error message.
654 XFS filesystem labels can be at most 12 characters long.
655
656 fsmap [ -d | -l | -r ] [ -m | -v ] [ -n nx ] [ start ] [ end ]
657 Prints the mapping of disk blocks used by the filesystem hosting
658 the current file. The map lists each extent used by files,
659 allocation group metadata, journalling logs, and static filesys‐
660 tem metadata, as well as any regions that are unused. Each line
661 of the listings takes the following form:
662
663 extent: major:minor [startblock..endblock]: owner startoff‐
664 set..endoffset length
665
666 Static filesystem metadata, allocation group metadata, btrees,
667 journalling logs, and free space are marked by replacing the
668 startoffset..endoffset with the appropriate marker. All blocks,
669 offsets, and lengths are specified in units of 512-byte blocks,
670 no matter what the filesystem's block size is. The optional
671 start and end arguments can be used to constrain the output to a
672 particular range of disk blocks. If these two options are spec‐
673 ified, exactly one of -d, -l, or -r must also be set.
674 -d Display only extents from the data device. This
675 option only applies for XFS filesystems.
676 -l Display only extents from the external log device.
677 This option only applies to XFS filesystems.
678 -r Display only extents from the realtime device. This
679 option only applies to XFS filesystems.
680 -m Display results in a machine readable format (CSV).
681 This option is not compatible with the -v flag. The
682 columns of the output are: extent number, device
683 major, device minor, physical start, physical end,
684 owner, offset start, offset end, length. The start,
685 end, and length numbers are provided in units of 512b.
686 The owner field is a special string that takes the
687 form:
688
689 inode_%lld_data
690 for inode data.
691 inode_%lld_data_bmbt
692 for inode data extent maps.
693 inode_%lld_attr
694 for inode extended attribute data.
695 inode_%lld_attr_bmbt
696 for inode extended attribute extent maps.
697 special_%u:%u
698 for other filesystem metadata.
699
700
701 -n num_extents
702 If this option is given, fsmap obtains the extent list
703 of the file in groups of num_extents extents. In the
704 absence of -n, fsmap queries the system for extents in
705 groups of 131,072 records.
706
707 -v Shows verbose information. When this flag is speci‐
708 fied, additional AG specific information is appended
709 to each line in the following form:
710
711 agno (startagblock..endagblock) nblocks flags
712
713 A second -v option will print out the flags legend.
714 This option is not compatible with the -m flag.
715
716
717
719 help [ command ]
720 Display a brief description of one or all commands.
721
722 print Display a list of all open files and memory mapped regions. The
723 current file and current mapping are distinguishable from any
724 others.
725
726 p See the print command.
727
728 quit Exit xfs_io.
729
730 q See the quit command.
731
732 log_writes -d device -m mark
733 Create a mark named mark in the dm-log-writes log specified by
734 device. This is intended to be equivalent to the shell command:
735
736 dmsetup message device 0 mark mark
737
738 lw See the log_writes command.
739
740 crc32cselftest
741 Test the internal crc32c implementation to make sure that it
742 computes results correctly.
743
745 mkfs.xfs(8), xfsctl(3), xfs_bmap(8), xfs_db(8), xfs(5), fdatasync(2),
746 fstat(2), fstatfs(2), fsync(2), ftruncate(2), futimens(3), mmap(2),
747 msync(2), open(2), pread(2), pwrite(2), readdir(3), dmsetup(8).
748
749
750
751 xfs_io(8)