Debian Codegraph @

upstream/debian-trixie/man8/xfs_db.8

raw
1 .TH xfs_db 8
2 .SH NAME
3 xfs_db \- debug an XFS filesystem
4 .SH SYNOPSIS
5 .B xfs_db
6 [
7 .B \-c
8 .I cmd
9 ] ... [
10 .BR \-i | r | x | F
11 ] [
12 .B \-f
13 ] [
14 .B \-l
15 .I logdev
16 ] [
17 .B \-R
18 .I rtdev
19 ] [
20 .B \-p
21 .I progname
22 ]
23 .I device
24 .br
25 .B xfs_db \-V
26 .SH DESCRIPTION
27 .B xfs_db
28 is used to examine an XFS filesystem. Under rare circumstances it can also
29 be used to modify an XFS filesystem, but that task is normally left to
30 .BR xfs_repair (8)
31 or to scripts such as
32 .BR xfs_admin (8)
33 that run
34 .BR xfs_db .
35 .PP
36 .SH OPTIONS
37 .TP
38 .BI \-c " cmd"
39 .B xfs_db
40 commands may be run interactively (the default) or as arguments
41 on the command line. Multiple
42 .B \-c
43 arguments may be given. The commands are run in the sequence given,
44 then the program exits.
45 .TP
46 .B \-f
47 Specifies that the filesystem image to be processed is stored in a
48 regular file at
49 .I device
50 (see the
51 .BR mkfs.xfs "(8) " -d
52 .I file
53 option).
54 This might happen if an image copy of a filesystem has been made into
55 an ordinary file with
56 .BR xfs_copy (8).
57 .TP
58 .B \-F
59 Specifies that we want to continue even if the superblock magic is not
60 correct. For use in
61 .BR xfs_metadump .
62 .TP
63 .B \-i
64 Allows execution on a mounted filesystem, provided it is mounted read-only.
65 Useful for shell scripts
66 which must only operate on filesystems in a guaranteed consistent state
67 (either unmounted or mounted read-only). These semantics are slightly
68 different to that of the
69 .B -r
70 option.
71 .TP
72 .BI \-l " logdev"
73 Specifies the device where the filesystems external log resides.
74 Only for those filesystems which use an external log. See the
75 .BR mkfs.xfs "(8) " \-l
76 option, and refer to
77 .BR xfs (5)
78 for a detailed description of the XFS log.
79 .TP
80 .BI \-p " progname"
81 Set the program name to
82 .I progname
83 for prompts and some error messages, the default value is
84 .BR xfs_db .
85 .TP
86 .B -R
87 .I rtdev
88 Specifies the device where the realtime data resides.
89 This is only relevant for filesystems that have a realtime section.
90 See the
91 .BR mkfs.xfs "(8) " \-r
92 option, and refer to
93 .BR xfs (5)
94 for a detailed description of the XFS realtime section.
95 .TP
96 .B -r
97 Open
98 .I device
99 or
100 .I filename
101 read-only. This option is required if the filesystem is mounted.
102 It is only necessary to omit this flag if a command that changes data
103 .RB ( write ", " blocktrash ", " crc )
104 is to be used.
105 .TP
106 .B \-x
107 Specifies expert mode.
108 This enables the
109 .RB ( write ", " blocktrash ", " crc
110 invalidate/revalidate) commands.
111 .TP
112 .B \-V
113 Prints the version number and exits.
114 .SH CONCEPTS
115 .B xfs_db
116 commands can be broken up into two classes. Most commands are for
117 the navigation and display of data structures in the filesystem.
118 Other commands are for scanning the filesystem in some way.
119 .PP
120 Commands which are used to navigate the filesystem structure take arguments
121 which reflect the names of filesystem structure fields.
122 There can be multiple field names separated by dots when the underlying
123 structures are nested, as in C.
124 The field names can be indexed (as an array index)
125 if the underlying field is an array.
126 The array indices can be specified as a range, two numbers separated by a dash.
127 .PP
128 .B xfs_db
129 maintains a current address in the filesystem.
130 The granularity of the address is a filesystem structure.
131 This can be a filesystem block,
132 an inode or quota (smaller than a filesystem block),
133 or a directory block (could be larger than a filesystem block).
134 There are a variety of commands to set the current address.
135 Associated with the current address is the current data type,
136 which is the structural type of this data.
137 Commands which follow the structure of the filesystem always set the type
138 as well as the address.
139 Commands which examine pieces of an individual file (inode) need the current
140 inode to be set, this is done with the
141 .B inode
142 command.
143 .PP
144 The current address/type information is actually maintained in a
145 stack that can be explicitly manipulated with the
146 .BR push ", " pop ", and " stack
147 commands.
148 This allows for easy examination of a nested filesystem structure.
149 Also, the last several locations visited are stored in a ring buffer
150 which can be manipulated with the
151 .BR forward ", " back ", and " ring
152 commands.
153 .PP
154 XFS filesystems are divided into a small number of allocation groups.
155 .B xfs_db
156 maintains a notion of the current allocation group which is
157 manipulated by some commands. The initial allocation group is 0.
158 .SH COMMANDS
159 .PP
160 Many commands have extensive online help. Use the
161 .B help
162 command for more details on any command.
163 .TP
164 .B a
165 See the
166 .B addr
167 command.
168 .TP
169 .BI ablock " filoff"
170 Set current address to the offset
171 .I filoff
172 (a filesystem block number) in the attribute area of the current inode.
173 .TP
174 .BI "addr [" field-expression ]
175 Set current address to the value of the
176 .IR field-expression .
177 This is used to "follow" a reference in one structure to the object
178 being referred to. If no argument is given, the current address is printed.
179 .TP
180 .BI "agf [" agno ]
181 Set current address to the AGF block for allocation group
182 .IR agno .
183 If no argument is given, use the current allocation group.
184 .TP
185 .BI "agfl [" agno ]
186 Set current address to the AGFL block for allocation group
187 .IR agno .
188 If no argument is given, use the current allocation group.
189 .TP
190 .BI "agi [" agno ]
191 Set current address to the AGI block for allocation group
192 .IR agno .
193 If no argument is given, use the current allocation group.
194 .TP
195 .BI "agresv [" agno ]
196 Displays the length, free block count, per-AG reservation size, and per-AG
197 reservation usage for a given AG.
198 If no argument is given, display information for all AGs.
199 .TP
200 .BI "attr_get [\-p|\-r|\-u|\-s|\-Z] [\-N " namefile "|" name "] "
201 Print the value of the specified extended attribute from the current file.
202 .RS 1.0i
203 .TP 0.4i
204 .B \-p
205 Sets the attribute in the parent namespace.
206 Only one namespace option can be specified.
207 .TP
208 .B \-r
209 Sets the attribute in the root namespace.
210 Only one namespace option can be specified.
211 .TP
212 .B \-u
213 Sets the attribute in the user namespace.
214 Only one namespace option can be specified.
215 .TP
216 .B \-s
217 Sets the attribute in the secure namespace.
218 Only one namespace option can be specified.
219 .TP
220 .B \-Z
221 Sets a filesystem property in the root namespace.
222 Only one namespace option can be specified.
223 .TP
224 .B \-N
225 Read the name from this file.
226 .RE
227 .TP
228 .BI "attr_list [\-p|\-r|\-u|\-s|\-Z] [\-v] "
229 Lists the extended attributes of the current file.
230 .RS 1.0i
231 .TP 0.4i
232 .B \-p
233 Sets the attribute in the parent namespace.
234 Only one namespace option can be specified.
235 .TP
236 .B \-r
237 Sets the attribute in the root namespace.
238 Only one namespace option can be specified.
239 .TP
240 .B \-u
241 Sets the attribute in the user namespace.
242 Only one namespace option can be specified.
243 .TP
244 .B \-s
245 Sets the attribute in the secure namespace.
246 Only one namespace option can be specified.
247 .TP
248 .B \-Z
249 Sets a filesystem property in the root namespace.
250 Only one namespace option can be specified.
251 .TP
252 .B \-v
253 Print the extended attribute values too.
254 .RE
255 .TP
256 .BI "attr_remove [\-p|\-r|\-u|\-s|\-Z] [\-n] [\-N " namefile "|" name "] "
257 Remove the specified extended attribute from the current file.
258 .RS 1.0i
259 .TP 0.4i
260 .B \-p
261 Sets the attribute in the parent namespace.
262 Only one namespace option can be specified.
263 .TP
264 .B \-r
265 Sets the attribute in the root namespace.
266 Only one namespace option can be specified.
267 .TP
268 .B \-u
269 Sets the attribute in the user namespace.
270 Only one namespace option can be specified.
271 .TP
272 .B \-s
273 Sets the attribute in the secure namespace.
274 Only one namespace option can be specified.
275 .TP
276 .B \-Z
277 Sets a filesystem property in the root namespace.
278 Only one namespace option can be specified.
279 .TP
280 .B \-N
281 Read the name from this file.
282 .TP
283 .B \-n
284 Do not enable 'noattr2' mode on V4 filesystems.
285 .RE
286 .TP
287 .BI "attr_set [\-p\-r|\-u|\-s|\-Z] [\-n] [\-R|\-C] [\-v " valuelen "|\-V " valuefile "] [\-N " namefile "|" name "] [" value "]"
288 Sets an extended attribute on the current file with the given name.
289 .RS 1.0i
290 .TP 0.4i
291 .B \-p
292 Sets the attribute in the parent namespace.
293 Only one namespace option can be specified.
294 .TP
295 .B \-r
296 Sets the attribute in the root namespace.
297 Only one namespace option can be specified.
298 .TP
299 .B \-u
300 Sets the attribute in the user namespace.
301 Only one namespace option can be specified.
302 .TP
303 .B \-s
304 Sets the attribute in the secure namespace.
305 Only one namespace option can be specified.
306 .TP
307 .B \-Z
308 Sets a filesystem property in the root namespace.
309 Only one namespace option can be specified.
310 .TP
311 .B \-N
312 Read the name from this file.
313 .TP
314 .B \-n
315 Do not enable 'noattr2' mode on V4 filesystems.
316 .TP
317 .B \-R
318 Replace the attribute.
319 The command will fail if the attribute does not already exist.
320 .TP
321 .B \-C
322 Create the attribute.
323 The command will fail if the attribute already exists.
324 .TP
325 .B \-V
326 Read the value from this file.
327 .TP
328 .B \-v
329 Set the attribute value to a string of this length containing the letter 'v'.
330 .RE
331 .TP
332 .B b
333 See the
334 .B back
335 command.
336 .TP
337 .B back
338 Move to the previous location in the position ring.
339 .TP
340 .B blockfree
341 Free block usage information collected by the last execution of the
342 .B blockget
343 command. This must be done before another
344 .B blockget
345 command can be given, presumably with different arguments than the previous one.
346 .TP
347 .BI "blockget [\-npvs] [\-b " bno "] ... [\-i " ino "] ..."
348 Get block usage.
349 The information is saved for use by a subsequent
350 .BR blockuse ", " ncheck ", or " blocktrash
351 command.
352 .RS 1.0i
353 .TP 0.4i
354 .B \-b
355 is used to specify filesystem block numbers about which verbose
356 information should be printed.
357 .TP
358 .B \-i
359 is used to specify inode numbers about which verbose information
360 should be printed.
361 .TP
362 .B \-n
363 is used to save pathnames for inodes visited, this is used to support the
364 .BR xfs_ncheck (8)
365 command. It also means that pathnames will be printed for inodes that have
366 problems. This option uses a lot of memory so is not enabled by default.
367 .TP
368 .B \-p
369 causes error messages to be prefixed with the filesystem name being
370 processed. This is useful if several copies of
371 .B xfs_db
372 are run in parallel.
373 .TP
374 .B \-s
375 restricts output to severe errors only. This is useful if the output is
376 too long otherwise.
377 .TP
378 .B \-v
379 enables verbose output. Messages will be printed for every block and
380 inode processed.
381 .RE
382 .TP
383 .BI "blocktrash [-z] [\-o " offset "] [\-n " count "] [\-x " min "] [\-y " max "] [\-s " seed "] [\-0|1|2|3] [\-t " type "] ..."
384 Trash randomly selected filesystem metadata blocks.
385 Trashing occurs to randomly selected bits in the chosen blocks.
386 This command is available only in debugging versions of
387 .BR xfs_db .
388 It is useful for testing
389 .BR xfs_repair "(8).
390 .RS 1.0i
391 .TP 0.4i
392 .BR \-0 " | " -1 " | " -2 " | " -3
393 These are used to set the operating mode for
394 .BR blocktrash .
395 Only one can be used:
396 .B \-0
397 changed bits are cleared;
398 .B \-1
399 changed bits are set;
400 .B -2
401 changed bits are inverted;
402 .B -3
403 changed bits are randomized.
404 .TP
405 .B \-n
406 supplies the
407 .I count
408 of block-trashings to perform (default 1).
409 .TP
410 .B \-o
411 supplies the bit
412 .I offset
413 at which to start trashing the block. If the value is preceded by a '+', the
414 trashing will start at a randomly chosen offset that is larger than the value
415 supplied. The default is to randomly choose an offset anywhere in the block.
416 .TP
417 .B \-s
418 supplies a
419 .I seed
420 to the random processing.
421 .TP
422 .B \-t
423 gives a
424 .I type
425 of blocks to be selected for trashing. Multiple
426 .B \-t
427 options may be given. If no
428 .B \-t
429 options are given then all metadata types can be trashed.
430 .TP
431 .B \-x
432 sets the
433 .I minimum
434 size of bit range to be trashed. The default value is 1.
435 .TP
436 .B \-y
437 sets the
438 .I maximum
439 size of bit range to be trashed. The default value is 1024.
440 .TP
441 .B \-z
442 trashes the block at the top of the stack. It is not necessary to
443 run
444 .BI blockget
445 if this option is supplied.
446 .RE
447 .TP
448 .BI "blockuse [\-n] [\-c " count ]
449 Print usage for current filesystem block(s).
450 For each block, the type and (if any) inode are printed.
451 .RS 1.0i
452 .TP 0.4i
453 .B \-c
454 specifies a
455 .I count
456 of blocks to process. The default value is 1 (the current block only).
457 .TP
458 .B \-n
459 specifies that file names should be printed. The prior
460 .B blockget
461 command must have also specified the
462 .B \-n
463 option.
464 .RE
465 .TP
466 .BI "bmap [\-a] [\-d] [" block " [" len ]]
467 Show the block map for the current inode.
468 The map display can be restricted to an area of the file with the
469 .I block
470 and
471 .I len
472 arguments. If
473 .I block
474 is given and
475 .I len
476 is omitted then 1 is assumed for len.
477 .IP
478 The
479 .B \-a
480 and
481 .B \-d
482 options are used to select the attribute or data
483 area of the inode, if neither option is given then both areas are shown.
484 .TP
485 .BI "bmapinflate [\-d " dirty_bytes "] [-e] [\-n " nr "]
486 Duplicates the first data fork mapping this many times, as if the mapping had
487 been repeatedly reflinked.
488 This is an expert-mode command for exercising high-refcount filesystems only.
489 Existing data fork mappings will be forgotten and the refcount btree will not
490 be updated.
491 This command leaves at least the refcount btree and the inode inconsistent;
492 .B xfs_repair
493 must be run afterwards.
494 .RS 1.0i
495 .TP 0.4i
496 .B \-d
497 Constrain the memory consumption of new dirty btree blocks to this quantity.
498 Defaults to 60MiB.
499 .TP 0.4i
500 .B \-e
501 Estimate the number of blocks and height of the new data fork mapping
502 structure and exit without changing anything.
503 .TP 0.4i
504 .B \-n
505 Create this many copies of the first mapping.
506 .RE
507 .TP
508 .B btdump [-a] [-i]
509 If the cursor points to a btree node, dump the btree from that block downward.
510 If instead the cursor points to an inode, dump the data fork block mapping btree if there is one.
511 If the cursor points to a directory or extended attribute btree node, dump that.
512 By default, only records stored in the btree are dumped.
513 .RS 1.0i
514 .TP 0.4i
515 .B \-a
516 If the cursor points at an inode, dump the extended attribute block mapping btree, if present.
517 .TP
518 .B \-i
519 Dump all keys and pointers in intermediate btree nodes, and all records in leaf btree nodes.
520 .RE
521 .TP
522 .BI "btheight [\-b " blksz "] [\-n " recs "] [\-w " max "|" min "|" absmax "] btree types..."
523 For a given number of btree records and a btree type, report the number of
524 records and blocks for each level of the btree, and the total number of blocks.
525 The btree type must be given after the options.
526
527 A raw btree geometry can be provided in the format
528 "record_bytes:key_bytes:ptr_bytes:header_type", where header_type is one of
529 "short", "long", "shortcrc", or "longcrc".
530
531 The supported btree types are:
532 .IR bnobt ,
533 .IR cntbt ,
534 .IR inobt ,
535 .IR finobt ,
536 .IR bmapbt ,
537 .IR refcountbt ,
538 and
539 .IR rmapbt .
540 The magic value
541 .I all
542 can be used to walk through all btree types.
543
544 Options are as follows:
545 .RS 1.0i
546 .TP 0.4i
547 .B \-b
548 is used to override the btree block size.
549 The default is the filesystem block size.
550 .TP
551 .B \-n
552 is used to specify the number of records to store.
553 This argument is required.
554 .TP
555 .B \-w absmax
556 shows the maximum possible height for the given btree types.
557 .TP
558 .B \-w max
559 shows only the best case scenario, which is when the btree blocks are
560 maximally loaded.
561 .TP
562 .B \-w min
563 shows only the worst case scenario, which is when the btree blocks are
564 half full.
565 .RE
566 .TP
567 .BI "convert " "type number" " [" "type number" "] ... " type
568 Convert from one address form to another.
569 The known
570 .IR type s,
571 with alternate names, are:
572 .RS 1.0i
573 .PD 0
574 .HP
575 .B agblock
576 or
577 .B agbno
578 (filesystem block within an allocation group)
579 .HP
580 .B agino
581 or
582 .B aginode
583 (inode number within an allocation group)
584 .HP
585 .B agnumber
586 or
587 .B agno
588 (allocation group number)
589 .HP
590 .B bboff
591 or
592 .B daddroff
593 (byte offset in a
594 .BR daddr )
595 .HP
596 .B blkoff
597 or
598 .B fsboff or
599 .B agboff
600 (byte offset in a
601 .B agblock
602 or
603 .BR fsblock )
604 .HP
605 .B byte
606 or
607 .B fsbyte
608 (byte address in filesystem)
609 .HP
610 .B daddr
611 or
612 .B bb
613 (disk address, 512-byte blocks)
614 .HP
615 .B fsblock
616 or
617 .B fsb
618 or
619 .B fsbno
620 (filesystem block, see the
621 .B fsblock
622 command)
623 .HP
624 .B ino
625 or
626 .B inode
627 (inode number)
628 .HP
629 .B inoidx
630 or
631 .B offset
632 (index of inode in filesystem block)
633 .HP
634 .B inooff
635 or
636 .B inodeoff
637 (byte offset in inode)
638 .PD
639 .RE
640 .IP
641 Only conversions that "make sense" are allowed.
642 The compound form (with more than three arguments) is useful for
643 conversions such as
644 .B convert agno
645 .I ag
646 .B agbno
647 .I agb
648 .BR fsblock .
649 .TP
650 .B crc [\-i|\-r|\-v]
651 Invalidates, revalidates, or validates the CRC (checksum)
652 field of the current structure, if it has one.
653 This command is available only on CRC-enabled filesystems.
654 With no argument, validation is performed.
655 Each command will display the resulting CRC value and state.
656 .RS 1.0i
657 .TP 0.4i
658 .B \-i
659 Invalidate the structure's CRC value (incrementing it by one),
660 and write it to disk.
661 .TP
662 .B \-r
663 Recalculate the current structure's correct CRC value, and write it to disk.
664 .TP
665 .B \-v
666 Validate and display the current value and state of the structure's CRC.
667 .RE
668 .TP
669 .BI "daddr [" -r "] [" d ]
670 Set current address to the daddr (512 byte block) given by
671 .IR d .
672 If no value for
673 .I d
674 is given, the current address is printed, expressed as a daddr.
675 The type is set to
676 .B data
677 (uninterpreted).
678
679 If an address and the
680 .B \-l
681 option are specified, the current address is set to the external log device.
682 If an address and the
683 .B \-r
684 option are specified, the current address is set to the realtime device.
685 .TP
686 .BI dblock " filoff"
687 Set current address to the offset
688 .I filoff
689 (a filesystem block number) in the data area of the current inode.
690 .TP
691 .BI "debug [" flagbits ]
692 Set debug option bits. These are used for debugging
693 .BR xfs_db .
694 If no value is given for
695 .IR flagbits ,
696 print the current debug option bits. These are for the use of the implementor.
697 .TP
698 .BI "dquot [" \-g | \-p | \-u ] " id"
699 Set current address to a group, project or user quota block for the given ID. Defaults to user quota.
700 .TP
701 .BI "dump_iunlinked [-a " agno " ] [-b " bucket " ] [-q] [-v]"
702 Dump the contents of unlinked buckets.
703
704 Options include:
705 .RS 1.0i
706 .TP 0.4i
707 .B \-a
708 Print only this AG's unlinked buckets.
709 .TP 0.4i
710 .B \-b
711 Print only this bucket within each AGI.
712 .TP 0.4i
713 .B \-q
714 Only print the essentials.
715 .TP 0.4i
716 .B \-v
717 Print resource usage of each file on the unlinked lists.
718 .RE
719 .TP
720 .BI "echo [" arg "] ..."
721 Echo the arguments to the output.
722 .TP
723 .B f
724 See the
725 .B forward
726 command.
727 .TP
728 .B forward
729 Move forward to the next entry in the position ring.
730 .TP
731 .B frag [\-adflqRrv]
732 Get file fragmentation data. This prints information about fragmentation
733 of file data in the filesystem (as opposed to fragmentation of freespace,
734 for which see the
735 .B freesp
736 command). Every file in the filesystem is examined to see how far from ideal
737 its extent mappings are. A summary is printed giving the totals.
738 .RS 1.0i
739 .TP 0.4i
740 .B \-v
741 sets verbosity, every inode has information printed for it.
742 The remaining options select which inodes and extents are examined.
743 If no options are given then all are assumed set,
744 otherwise just those given are enabled.
745 .TP
746 .B \-a
747 enables processing of attribute data.
748 .TP
749 .B \-d
750 enables processing of directory data.
751 .TP
752 .B \-f
753 enables processing of regular file data.
754 .TP
755 .B \-l
756 enables processing of symbolic link data.
757 .TP
758 .B \-q
759 enables processing of quota file data.
760 .TP
761 .B \-R
762 enables processing of realtime control file data.
763 .TP
764 .B \-r
765 enables processing of realtime file data.
766 .RE
767 .TP
768 .BI "freesp [\-bcds] [\-A " alignment "] [\-a " ag "] ... [\-e " i "] [\-h " h1 "] ... [\-m " m ]
769 Summarize free space for the filesystem. The free blocks are examined
770 and totalled, and displayed in the form of a histogram, with a count
771 of extents in each range of free extent sizes.
772 .RS 1.0i
773 .TP 0.4i
774 .B \-A
775 reports only free extents with starting blocks aligned to
776 .I alignment
777 blocks.
778 .TP
779 .B \-a
780 adds
781 .I ag
782 to the list of allocation groups to be processed. If no
783 .B \-a
784 options are given then all allocation groups are processed.
785 .TP
786 .B \-b
787 specifies that the histogram buckets are binary-sized, with the starting
788 sizes being the powers of 2.
789 .TP
790 .B \-c
791 specifies that
792 .B freesp
793 will search the by-size (cnt) space Btree instead of the default
794 by-block (bno) space Btree.
795 .TP
796 .B \-d
797 specifies that every free extent will be displayed.
798 .TP
799 .B \-e
800 specifies that the histogram buckets are
801 equal-sized, with the size specified as
802 .IR i .
803 .TP
804 .B \-h
805 specifies a starting block number for a histogram bucket as
806 .IR h1 .
807 Multiple
808 .BR \-h 's
809 are given to specify the complete set of buckets.
810 .TP
811 .B \-m
812 specifies that the histogram starting block numbers are powers of
813 .IR m .
814 This is the general case of
815 .BR \-b .
816 .TP
817 .B \-s
818 specifies that a final summary of total free extents,
819 free blocks, and the average free extent size is printed.
820 .RE
821 .TP
822 .B fsb
823 See the
824 .B fsblock
825 command.
826 .TP
827 .BI "fsblock [" fsb ]
828 Set current address to the fsblock value given by
829 .IR fsb .
830 If no value for
831 .I fsb
832 is given the current address is printed, expressed as an fsb.
833 The type is set to
834 .B data
835 (uninterpreted). XFS filesystem block numbers are computed
836 .RI (( agno " << " agshift ") | " agblock )
837 where
838 .I agshift
839 depends on the size of an allocation group. Use the
840 .B convert
841 command to convert to and from this form. Block numbers given for file blocks
842 (for instance from the
843 .B bmap
844 command) are in this form.
845 .TP
846 .BI "fsmap [ " start " ] [ " end " ]
847 Prints the mapping of disk blocks used by an XFS filesystem. The map
848 lists each extent used by files, allocation group metadata,
849 journalling logs, and static filesystem metadata, as well as any
850 regions that are unused. All blocks, offsets, and lengths are specified
851 in units of 512-byte blocks, no matter what the filesystem's block size is.
852 .BI "The optional " start " and " end " arguments can be used to constrain
853 the output to a particular range of disk blocks.
854 .TP
855 .BI "fuzz [\-c] [\-d] " "field action"
856 Write garbage into a specific structure field on disk.
857 Expert mode must be enabled to use this command.
858 The operation happens immediately; there is no buffering.
859 .IP
860 The fuzz command can take the following
861 .IR action "s"
862 against a field:
863 .RS 1.0i
864 .TP 0.4i
865 .B zeroes
866 Clears all bits in the field.
867 .TP 0.4i
868 .B ones
869 Sets all bits in the field.
870 .TP 0.4i
871 .B firstbit
872 Flips the first bit in the field.
873 For a scalar value, this is the highest bit.
874 .TP 0.4i
875 .B middlebit
876 Flips the middle bit in the field.
877 .TP 0.4i
878 .B lastbit
879 Flips the last bit in the field.
880 For a scalar value, this is the lowest bit.
881 .TP 0.4i
882 .B add
883 Adds a small value to a scalar field.
884 .TP 0.4i
885 .B sub
886 Subtracts a small value from a scalar field.
887 .TP 0.4i
888 .B random
889 Randomizes the contents of the field.
890 .RE
891 .IP
892 The following switches affect the write behavior:
893 .RS 1.0i
894 .TP 0.4i
895 .B \-c
896 Skip write verifiers and CRC recalculation; allows invalid data to be written
897 to disk.
898 .TP 0.4i
899 .B \-d
900 Skip write verifiers but perform CRC recalculation; allows invalid data to be
901 written to disk to test detection of invalid data.
902 .RE
903 .TP
904 .BI hash [-d|-p parent_ino]" strings
905 Prints the hash value of
906 .I string
907 using the hash function of the XFS directory and attribute implementation.
908
909 If the
910 .B \-d
911 option is specified, the directory-specific hash function is used.
912 This only makes a difference on filesystems with ascii case-insensitive
913 lookups enabled.
914
915 If the
916 .B \-p
917 option is specified, the parent pointer-specific hash function is used.
918 The parent directory inumber must be specified as an argument.
919 This only makes a difference on filesystems with ascii case-insensitive
920 lookups enabled.
921 .TP
922 .BI "hashcoll [-a] [-s seed] [-n " nr "] [-p " path "] -i | " names...
923 Create directory entries or extended attributes names that all have the same
924 hash value.
925 The metadump name obfuscation algorithm is used here.
926 Names are written to standard output, with a NULL between each name for use
927 with xargs -0.
928 .RS 1.0i
929 .PD 0
930 .TP 0.4i
931 .TP 0.4i
932 .B \-a
933 Create extended attribute names.
934 .TP 0.4i
935 .B \-i
936 Read the first name to create from standard input.
937 Up to 255 bytes are read.
938 If this option is not specified, first names are taken from the command line.
939 .TP 0.4i
940 .BI \-n " nr"
941 Create this many duplicated names.
942 The default is to create one name.
943 .TP 0.4i
944 .BI \-p " path"
945 Create directory entries or extended attributes in this file instead of
946 writing the names to standard output.
947 .TP 0.4i
948 .BI \-s " seed"
949 Seed the random number generator with this value.
950 .PD
951 .RE
952 .TP
953 .BI "help [" command ]
954 Print help for one or all commands.
955 .TP
956 .B info
957 Displays selected geometry information about the filesystem.
958 The output will have the same format that
959 .BR "mkfs.xfs" "(8)"
960 prints when creating a filesystem or
961 .BR "xfs_info" "(8)"
962 prints when querying a filesystem.
963 .TP
964 .BI "inode [" inode# ]
965 Set the current inode number. If no
966 .I inode#
967 is given, print the current inode number.
968 .TP
969 .BI "iunlink [-n " nr " ]"
970 Allocate inodes and put them on the unlinked list.
971
972 Options include:
973 .RS 1.0i
974 .TP 0.4i
975 .B \-n
976 Create this number of unlinked inodes.
977 If not specified, 1 inode will be created.
978 .RE
979 .TP
980 .BI "label [" label ]
981 Set the filesystem label. The filesystem label can be used by
982 .BR mount (8)
983 instead of using a device special file.
984 The maximum length of an XFS label is 12 characters \- use of a longer
985 .I label
986 will result in truncation and a warning will be issued. If no
987 .I label
988 is given, the current filesystem label is printed.
989 .TP
990 .BI "link [-i " ino "] [-m] [-p " path "] [-t " ftype "] name"
991 In the current directory, create a directory entry with the given
992 .I name
993 pointing to a file.
994 The file must be specified either as a directory tree path as given by the
995 .I path
996 option; or directly as an inode number as given by the
997 .I ino
998 option.
999 The file type in the directory entry will be determined from the mode of the
1000 child file unless the
1001 .I ftype
1002 option is given.
1003 The
1004 .B -m
1005 option specifies that the path lookup should be done in the metadata directory
1006 tree.
1007 The file being targetted must not be on the iunlink list.
1008 .TP
1009 .BI "log [stop | start " filename ]
1010 Start logging output to
1011 .IR filename ,
1012 stop logging, or print the current logging status.
1013 .TP
1014 .BI "logblock [" logbno ]
1015 Set current address to the log block value given by
1016 .IR logbno .
1017 If no value for
1018 .I logbno
1019 is given the current address is printed, expressed as an fsb.
1020 The type is set to
1021 .B data
1022 (uninterpreted).
1023 If the filesystem has an external log, then the address will be within the log
1024 device.
1025 If the filesystem has an internal log, then the address will be within the
1026 internal log.
1027 .TP
1028 .BI "logformat [\-c " cycle "] [\-s " sunit "]"
1029 Reformats the log to the specified log cycle and log stripe unit.
1030 This has the effect of clearing the log destructively.
1031 If the log cycle is not specified, the log is reformatted to the current cycle.
1032 If the log stripe unit is not specified, the stripe unit from the filesystem
1033 superblock is used.
1034 .TP
1035 .B logres
1036 Print transaction reservation size information for each transaction type.
1037 This makes it easier to find discrepancies in the reservation calculations
1038 between xfsprogs and the kernel, which will help when diagnosing minimum
1039 log size calculation errors.
1040 .TP
1041 .BI "ls [\-im] [" paths "]..."
1042 List the contents of a directory.
1043 If a path resolves to a directory, the directory will be listed.
1044 If no paths are supplied and the IO cursor points at a directory inode,
1045 the contents of that directory will be listed.
1046
1047 The output format is:
1048 directory cookie, inode number, file type, hash, name length, name.
1049 .RS 1.0i
1050 .TP 0.4i
1051 .B \-i
1052 Resolve each of the given paths to an inode number and print that number.
1053 If no paths are given and the IO cursor points to an inode, print the inode
1054 number.
1055 .TP
1056 .B \-m
1057 Absolute paths should be walked from the root of the metadata directory tree.
1058 .RE
1059 .TP
1060 .BI "metadump [\-egow] " filename
1061 Dumps metadata to a file. See
1062 .BR xfs_metadump (8)
1063 for more information.
1064 .TP
1065 .BI "ncheck [\-s] [\-i " ino "] ..."
1066 Print name-inode pairs. A
1067 .B blockget \-n
1068 command must be run first to gather the information.
1069 .RS 1.0i
1070 .TP 0.4i
1071 .B \-i
1072 specifies an inode number to be printed. If no
1073 .B \-i
1074 options are given then all inodes are printed.
1075 .TP
1076 .B \-s
1077 specifies that only setuid and setgid files are printed.
1078 .RE
1079 .TP
1080 .B p
1081 See the
1082 .B print
1083 command.
1084 .TP
1085 .BI "parent [\-m] [" paths "]..."
1086 List the parents of a file.
1087 If a path resolves to a file, the parents of that file will be listed.
1088 If no paths are supplied and the IO cursor points at an inode, the parents of
1089 that file will be listed.
1090 The
1091 .B \-m
1092 option causes absolute paths to be walked from the root of the metadata
1093 directory tree.
1094
1095 The output format is:
1096 inode number, inode generation, ondisk namehash, namehash, name length, name.
1097 .TP
1098 .BI "path [\-m] " dir_path
1099 Walk the directory tree to an inode using the supplied path.
1100 Absolute and relative paths are supported.
1101 The
1102 .B \-m
1103 option causes absolute paths to be walked from the root of the metadata
1104 directory tree.
1105 .TP
1106 .B pop
1107 Pop location from the stack.
1108 .TP
1109 .BI "print [" field-expression "] ..."
1110 Print field values.
1111 If no argument is given, print all fields in the current structure.
1112 .TP
1113 .BI "push [" command ]
1114 Push location to the stack. If
1115 .I command
1116 is supplied, set the current location to the results of
1117 .I command
1118 after pushing the old location.
1119 .TP
1120 .B q
1121 See the
1122 .B quit
1123 command.
1124 .TP
1125 .B quit
1126 Exit
1127 .BR xfs_db .
1128 .TP
1129 .BI "rtblock [" rtbno ]
1130 Set current address to the location on the realtime device given by
1131 .IR rtbno .
1132 This value must be a realtime block number.
1133 If no value for
1134 .I rtbno
1135 is given the current address is printed, expressed as an rtbno.
1136 The type is set to
1137 .B data
1138 (uninterpreted).
1139 .TP
1140 .BI "rtextent [" rtxno ]
1141 Set current address to the location on the realtime device given by
1142 .IR rtextent .
1143 This value must be a linear address in units of realtime extents.
1144 If no value for
1145 .I rtextent
1146 is given the current address is printed, expressed as an rtextent.
1147 The type is set to
1148 .B data
1149 (uninterpreted).
1150 .TP
1151 .BI "ring [" index ]
1152 Show position ring (if no
1153 .I index
1154 argument is given), or move to a specific entry in the position ring given by
1155 .IR index .
1156 .TP
1157 .BI "rtconvert " "type number" " [" "type number" "] ... " type
1158 Convert from one address form to another for realtime section addresses.
1159 The known
1160 .IR type s,
1161 with alternate names, are:
1162 .RS 1.0i
1163 .PD 0
1164 .HP
1165 .B rgblock
1166 or
1167 .B rgbno
1168 (realtime block within a realtime group)
1169 .HP
1170 .B rgnumber
1171 or
1172 .B rgno
1173 (realtime group number)
1174 .HP
1175 .B bboff
1176 or
1177 .B daddroff
1178 (byte offset in a
1179 .BR daddr )
1180 .HP
1181 .B blkoff
1182 or
1183 .B fsboff or
1184 .B rtboff
1185 (byte offset in a
1186 .B rtblock
1187 or
1188 .BR rtextent )
1189 .HP
1190 .B byte
1191 or
1192 .B fsbyte
1193 (byte address in filesystem)
1194 .HP
1195 .B daddr
1196 or
1197 .B bb
1198 (disk address, 512-byte blocks)
1199 .HP
1200 .B rtblock
1201 or
1202 .B rtb
1203 or
1204 .B rtbno
1205 (realtime filesystem block, see the
1206 .B fsblock
1207 command)
1208 .HP
1209 .B rtx
1210 or
1211 .B rtextent
1212 (realtime extent)
1213 .HP
1214 .B rbmblock
1215 or
1216 .B rbmb
1217 (realtime bitmap block)
1218 .HP
1219 .B rbmword
1220 or
1221 .B rbmw
1222 (32-bit word within a realtime bitmap block)
1223 .HP
1224 .B rsumblock
1225 or
1226 .B rsmb
1227 (realtime summary file block)
1228 .HP
1229 .B rsuminfo
1230 or
1231 .B rsmi
1232 (32-bit counter within a realtime summary block)
1233 .HP
1234 .B rsumlog
1235 or
1236 .B rsml
1237 (log2len parameter used for summary file offset computations)
1238 .PD
1239 .RE
1240 .IP
1241 Only conversions that "make sense" are allowed.
1242 The compound form (with more than three arguments) is useful for
1243 conversions such as
1244 .B convert rgno
1245 .I rg
1246 .B rgbno
1247 .I rgb
1248 .BR rtblock .
1249
1250 Realtime summary file location conversions have the following rules:
1251 Each info word in the rt summary file counts the number of free extents of a
1252 given log2(length) that start in a given rt bitmap block.
1253
1254 To compute summary file location information for a given rt bitmap block, a
1255 log2(extent length) must be specified as the last type/number pair before the
1256 conversion type, and the type must be
1257 .BR rsumlog .
1258
1259 For example, these commands tell us where to look in the rt summary file for
1260 the number of free rtextents of length 2^21 starting in rt bitmap block 30:
1261
1262 .B rtconvert rbmblock 30 rsumlog 21 rsumblock
1263
1264 .B rtconvert rbmblock 30 rsumlog 21 rsuminfo
1265
1266 To compute the rt bitmap block from summary file location, the type/number
1267 pairs must be specified exactly in the order
1268 .BR rsumlog ", " rsuminfo ", " rsumblock .
1269
1270 For example, this command tells us which block in the rt bitmap file is
1271 summarized by info word 809 in rt summary block 10 assuming that the
1272 maximum free extent length is 2^21 rtextents:
1273
1274 .B rtconvert rsumlog 21 rsuminfo 809 rsumblock 10 rbmblock
1275
1276 .TP
1277 .BI "sb [" agno ]
1278 Set current address to SB header in allocation group
1279 .IR agno .
1280 If no
1281 .I agno
1282 is given, use the current allocation group number.
1283 .TP
1284 .BI "source " source-file
1285 Process commands from
1286 .IR source-file .
1287 .B source
1288 commands can be nested.
1289 .TP
1290 .B stack
1291 View the location stack.
1292 .TP
1293 .BI "type [" type ]
1294 Set the current data type to
1295 .IR type .
1296 If no argument is given, show the current data type.
1297 The possible data types are:
1298 .BR agf ", " agfl ", " agi ", " attr ", " bmapbta ", " bmapbtd ,
1299 .BR bnobt ", " cntbt ", " data ", " dir ", " dir2 ", " dqblk ,
1300 .BR inobt ", " inode ", " log ", " refcntbt ", " rmapbt ", " rtbitmap ,
1301 .BR rtsummary ", " sb ", " symlink " and " text .
1302 See the TYPES section below for more information on these data types.
1303 .TP
1304 .BI "timelimit [" OPTIONS ]
1305 Print the minimum and maximum supported values for inode timestamps,
1306 quota expiration timers, and quota grace periods supported by this
1307 filesystem.
1308 Options include:
1309 .RS 1.0i
1310 .TP 0.4i
1311 .B \--bigtime
1312 Print the time limits of an XFS filesystem with the
1313 .B bigtime
1314 feature enabled.
1315 .TP 0.4i
1316 .B \--classic
1317 Print the time limits of a classic XFS filesystem.
1318 .TP 0.4i
1319 .B \--compact
1320 Print all limits as raw values on a single line.
1321 .TP 0.4i
1322 .B \--pretty
1323 Print the timestamps in the current locale's date and time format instead of
1324 raw seconds since the Unix epoch.
1325 .RE
1326 .TP
1327 .BI "unlink name"
1328 In the current directory, remove a directory entry with the given
1329 .IR name .
1330 The file being targetted will not be put on the iunlink list.
1331 .TP
1332 .BI "uuid [" uuid " | " generate " | " rewrite " | " restore ]
1333 Set the filesystem universally unique identifier (UUID).
1334 The filesystem UUID can be used by
1335 .BR mount (8)
1336 instead of using a device special file.
1337 The
1338 .I uuid
1339 can be set directly to the desired UUID, or it can
1340 be automatically generated using the
1341 .B generate
1342 option. These options will both write the UUID into every copy of the
1343 superblock in the filesystem. On a CRC-enabled filesystem, this will
1344 set an incompatible superblock flag, and the filesystem will not be
1345 mountable with older kernels. This can be reverted with the
1346 .B restore
1347 option, which will copy the original UUID back into place and clear
1348 the incompatible flag as needed.
1349 .B rewrite
1350 copies the current UUID from the primary superblock
1351 to all secondary copies of the superblock.
1352 If no argument is given, the current filesystem UUID is printed.
1353 .TP
1354 .BI "version [" feature " | " "versionnum features2" ]
1355 Enable selected features for a filesystem (certain features can
1356 be enabled on an unmounted filesystem, after
1357 .BR mkfs.xfs (8)
1358 has created the filesystem).
1359 Support for unwritten extents can be enabled using the
1360 .B extflg
1361 option. Support for version 2 log format can be enabled using the
1362 .B log2
1363 option. Support for extended attributes can be enabled using the
1364 .B attr1
1365 or
1366 .B attr2
1367 option. Once enabled, extended attributes cannot be disabled, but the user
1368 may toggle between
1369 .B attr1
1370 and
1371 .B attr2
1372 at will (older kernels may not support the newer version).
1373 .IP
1374 If no argument is given, the current version and feature bits are printed.
1375 With one argument, this command will write the updated version number
1376 into every copy of the superblock in the filesystem.
1377 If two arguments are given, they will be used as numeric values for the
1378 .I versionnum
1379 and
1380 .I features2
1381 bits respectively, and their string equivalent reported
1382 (but no modifications are made).
1383 .TP
1384 .BI "write [\-c|\-d] [" "field value" "] ..."
1385 Write a value to disk.
1386 Specific fields can be set in structures (struct mode),
1387 or a block can be set to data values (data mode),
1388 or a block can be set to string values (string mode, for symlink blocks).
1389 The operation happens immediately: there is no buffering.
1390 .IP
1391 Struct mode is in effect when the current type is structural,
1392 i.e. not data. For struct mode, the syntax is "\c
1393 .B write
1394 .I field value\c
1395 ".
1396 .IP
1397 Data mode is in effect when the current type is data. In this case the
1398 contents of the block can be shifted or rotated left or right, or filled
1399 with a sequence, a constant value, or a random value. In this mode
1400 .B write
1401 with no arguments gives more information on the allowed commands.
1402 .RS 1.0i
1403 .TP 0.4i
1404 .B \-c
1405 Skip write verifiers and CRC recalculation; allows invalid data to be written
1406 to disk.
1407 .TP 0.4i
1408 .B \-d
1409 Skip write verifiers but perform CRC recalculation.
1410 This allows invalid data to be written to disk to
1411 test detection of invalid data. (This is not possible for some types.)
1412 .RE
1413 .SH TYPES
1414 This section gives the fields in each structure type and their meanings.
1415 Note that some types of block cover multiple actual structures,
1416 for instance directory blocks.
1417 .TP 1.0i
1418 .B agf
1419 The AGF block is the header for block allocation information;
1420 it is in the second 512-byte block of each allocation group.
1421 The following fields are defined:
1422 .RS 1.4i
1423 .PD 0
1424 .TP 1.2i
1425 .B magicnum
1426 AGF block magic number, 0x58414746 ('XAGF').
1427 .TP
1428 .B versionnum
1429 version number, currently 1.
1430 .TP
1431 .B seqno
1432 sequence number starting from 0.
1433 .TP
1434 .B length
1435 size in filesystem blocks of the allocation group. All allocation
1436 groups except the last one of the filesystem have the superblock's
1437 .B agblocks
1438 value here.
1439 .TP
1440 .B bnoroot
1441 block number of the root of the Btree holding free space
1442 information sorted by block number.
1443 .TP
1444 .B cntroot
1445 block number of the root of the Btree holding free space
1446 information sorted by block count.
1447 .TP
1448 .B bnolevel
1449 number of levels in the by-block-number Btree.
1450 .TP
1451 .B cntlevel
1452 number of levels in the by-block-count Btree.
1453 .TP
1454 .B flfirst
1455 index into the AGFL block of the first active entry.
1456 .TP
1457 .B fllast
1458 index into the AGFL block of the last active entry.
1459 .TP
1460 .B flcount
1461 count of active entries in the AGFL block.
1462 .TP
1463 .B freeblks
1464 count of blocks represented in the freespace Btrees.
1465 .TP
1466 .B longest
1467 longest free space represented in the freespace Btrees.
1468 .TP
1469 .B btreeblks
1470 number of blocks held in the AGF Btrees.
1471 .PD
1472 .RE
1473 .TP
1474 .B agfl
1475 The AGFL block contains block numbers for use of the block allocator;
1476 it is in the fourth 512-byte block of each allocation group.
1477 Each entry in the active list is a block number within the allocation group
1478 that can be used for any purpose if space runs low.
1479 The AGF block fields
1480 .BR flfirst ", " fllast ", and " flcount
1481 designate which entries are currently active.
1482 Entry space is allocated in a circular manner within the AGFL block.
1483 Fields defined:
1484 .RS 1.4i
1485 .PD 0
1486 .TP 1.2i
1487 .B bno
1488 array of all block numbers. Even those which are not active are printed.
1489 .PD
1490 .RE
1491 .TP
1492 .B agi
1493 The AGI block is the header for inode allocation information;
1494 it is in the third 512-byte block of each allocation group.
1495 Fields defined:
1496 .RS 1.4i
1497 .PD 0
1498 .TP 1.2i
1499 .B magicnum
1500 AGI block magic number, 0x58414749 ('XAGI').
1501 .TP
1502 .B versionnum
1503 version number, currently 1.
1504 .TP
1505 .B seqno
1506 sequence number starting from 0.
1507 .TP
1508 .B length
1509 size in filesystem blocks of the allocation group.
1510 .TP
1511 .B count
1512 count of inodes allocated.
1513 .TP
1514 .B root
1515 block number of the root of the Btree holding inode allocation information.
1516 .TP
1517 .B level
1518 number of levels in the inode allocation Btree.
1519 .TP
1520 .B freecount
1521 count of allocated inodes that are not in use.
1522 .TP
1523 .B newino
1524 last inode number allocated.
1525 .TP
1526 .B dirino
1527 unused.
1528 .TP
1529 .B unlinked
1530 an array of inode numbers within the allocation group. The entries
1531 in the AGI block are the heads of lists which run through the inode
1532 .B next_unlinked
1533 field. These inodes are to be unlinked the next time the filesystem is mounted.
1534 .PD
1535 .RE
1536 .TP
1537 .B attr
1538 An attribute fork is organized as a Btree with the actual data embedded
1539 in the leaf blocks. The root of the Btree is found in block 0 of the fork.
1540 The index (sort order) of the Btree is the hash value of the attribute name.
1541 All the blocks contain a
1542 .B blkinfo
1543 structure at the beginning, see type
1544 .B dir
1545 for a description. Nonleaf blocks are identical in format to those for
1546 version 1 and version 2 directories, see type
1547 .B dir
1548 for a description. Leaf blocks can refer to "local" or "remote" attribute
1549 values. Local values are stored directly in the leaf block.
1550 Leaf blocks contain the following fields:
1551 .RS 1.4i
1552 .PD 0
1553 .TP 1.2i
1554 .B hdr
1555 header containing a
1556 .B blkinfo
1557 structure
1558 .B info
1559 (magic number 0xfbee), a
1560 .B count
1561 of active entries,
1562 .B usedbytes
1563 total bytes of names and values, the
1564 .B firstused
1565 byte in the name area,
1566 .B holes
1567 set if the block needs compaction, and array
1568 .B freemap
1569 as for
1570 .B dir
1571 leaf blocks.
1572 .TP
1573 .B entries
1574 array of structures containing a
1575 .BR hashval ,
1576 .B nameidx
1577 (index into the block of the name), and flags
1578 .BR incomplete ,
1579 .BR root ,
1580 and
1581 .BR local .
1582 .TP
1583 .B nvlist
1584 array of structures describing the attribute names and values. Fields
1585 always present:
1586 .B valuelen
1587 (length of value in bytes),
1588 .BR namelen ,
1589 and
1590 .BR name .
1591 Fields present for local values:
1592 .B value
1593 (value string). Fields present for remote values:
1594 .B valueblk
1595 (fork block number of containing the value).
1596 .PD
1597 .RE
1598 .IP
1599 Remote values are stored in an independent block in the attribute fork.
1600 Prior to v5, value blocks had no structure, but in v5 they acquired a header
1601 structure with the following fields:
1602 .RS 1.4i
1603 .PD 0
1604 .TP 1.2i
1605 .B magic
1606 attr3 remote block magic number, 0x5841524d ('XARM').
1607 .TP
1608 .B offset
1609 Byte offset of this data block within the overall attribute value.
1610 .TP
1611 .B bytes
1612 Number of bytes stored in this block.
1613 .TP
1614 .B crc
1615 Checksum of the attribute block contents.
1616 .TP
1617 .B uuid
1618 Filesystem UUID.
1619 .TP
1620 .B owner
1621 Inode that owns this attribute value.
1622 .TP
1623 .B bno
1624 Block offset of this block within the inode's attribute fork.
1625 .TP
1626 .B lsn
1627 Log serial number of the last time this block was logged.
1628 .TP
1629 .B data
1630 The attribute value data.
1631 .PD
1632 .RE
1633 .TP
1634 .B bmapbt
1635 Files with many extents in their data or attribute fork will have the
1636 extents described by the contents of a Btree for that fork,
1637 instead of being stored directly in the inode.
1638 Each bmap Btree starts with a root block contained within the inode.
1639 The other levels of the Btree are stored in filesystem blocks.
1640 The blocks are linked to sibling left and right blocks at each level,
1641 as well as by pointers from parent to child blocks.
1642 Each block contains the following fields:
1643 .RS 1.4i
1644 .PD 0
1645 .TP 1.2i
1646 .B magic
1647 bmap Btree block magic number, 0x424d4150 ('BMAP').
1648 .TP
1649 .B level
1650 level of this block above the leaf level.
1651 .TP
1652 .B numrecs
1653 number of records or keys in the block.
1654 .TP
1655 .B leftsib
1656 left (logically lower) sibling block, 0 if none.
1657 .TP
1658 .B rightsib
1659 right (logically higher) sibling block, 0 if none.
1660 .TP
1661 .B recs
1662 [leaf blocks only] array of extent records.
1663 Each record contains
1664 .BR startoff ,
1665 .BR startblock ,
1666 .BR blockcount ,
1667 and
1668 .B extentflag
1669 (1 if the extent is unwritten).
1670 .TP
1671 .B keys
1672 [non-leaf blocks only] array of key records. These are the first key
1673 value of each block in the level below this one. Each record contains
1674 .BR startoff .
1675 .TP
1676 .B ptrs
1677 [non-leaf blocks only] array of child block pointers.
1678 Each pointer is a filesystem block number to the next level in the Btree.
1679 .PD
1680 .RE
1681 .TP
1682 .B bnobt
1683 There is one set of filesystem blocks forming the by-block-number
1684 allocation Btree for each allocation group. The root block of this
1685 Btree is designated by the
1686 .B bnoroot
1687 field in the corresponding AGF block.
1688 The blocks are linked to sibling left and right blocks at each level,
1689 as well as by pointers from parent to child blocks.
1690 Each block has the following fields:
1691 .RS 1.4i
1692 .PD 0
1693 .TP 1.2i
1694 .B magic
1695 BNOBT block magic number, 0x41425442 ('ABTB').
1696 .TP
1697 .B level
1698 level number of this block, 0 is a leaf.
1699 .TP
1700 .B numrecs
1701 number of data entries in the block.
1702 .TP
1703 .B leftsib
1704 left (logically lower) sibling block, 0 if none.
1705 .TP
1706 .B rightsib
1707 right (logically higher) sibling block, 0 if none.
1708 .TP
1709 .B recs
1710 [leaf blocks only] array of freespace records. Each record contains
1711 .B startblock
1712 and
1713 .BR blockcount .
1714 .TP
1715 .B keys
1716 [non-leaf blocks only] array of key records. These are the first value
1717 of each block in the level below this one. Each record contains
1718 .B startblock
1719 and
1720 .BR blockcount .
1721 .TP
1722 .B ptrs
1723 [non-leaf blocks only] array of child block pointers. Each pointer is a
1724 block number within the allocation group to the next level in the Btree.
1725 .PD
1726 .RE
1727 .TP
1728 .B cntbt
1729 There is one set of filesystem blocks forming the by-block-count
1730 allocation Btree for each allocation group. The root block of this
1731 Btree is designated by the
1732 .B cntroot
1733 field in the corresponding AGF block. The blocks are linked to sibling
1734 left and right blocks at each level, as well as by pointers from parent
1735 to child blocks. Each block has the following fields:
1736 .RS 1.4i
1737 .PD 0
1738 .TP 1.2i
1739 .B magic
1740 CNTBT block magic number, 0x41425443 ('ABTC').
1741 .TP
1742 .B level
1743 level number of this block, 0 is a leaf.
1744 .TP
1745 .B numrecs
1746 number of data entries in the block.
1747 .TP
1748 .B leftsib
1749 left (logically lower) sibling block, 0 if none.
1750 .TP
1751 .B rightsib
1752 right (logically higher) sibling block, 0 if none.
1753 .TP
1754 .B recs
1755 [leaf blocks only] array of freespace records. Each record contains
1756 .B startblock
1757 and
1758 .BR blockcount .
1759 .TP
1760 .B keys
1761 [non-leaf blocks only] array of key records. These are the first value
1762 of each block in the level below this one. Each record contains
1763 .B blockcount
1764 and
1765 .BR startblock .
1766 .TP
1767 .B ptrs
1768 [non-leaf blocks only] array of child block pointers. Each pointer is a
1769 block number within the allocation group to the next level in the Btree.
1770 .PD
1771 .RE
1772 .TP
1773 .B data
1774 User file blocks, and other blocks whose type is unknown, have this
1775 type for display purposes in
1776 .BR xfs_db .
1777 The block data is displayed in hexadecimal format.
1778 .TP
1779 .B dir
1780 A version 1 directory is organized as a Btree with the directory data
1781 embedded in the leaf blocks. The root of the Btree is found in block 0
1782 of the file. The index (sort order) of the Btree is the hash value of
1783 the entry name. All the blocks contain a
1784 .B blkinfo
1785 structure at the beginning with the following fields:
1786 .RS 1.4i
1787 .PD 0
1788 .TP 1.2i
1789 .B forw
1790 next sibling block.
1791 .TP
1792 .B back
1793 previous sibling block.
1794 .TP
1795 .B magic
1796 magic number for this block type.
1797 .RE
1798 .IP
1799
1800 The non-leaf (node) blocks have the following fields:
1801 .RS 1.4i
1802 .TP 1.2i
1803 .B hdr
1804 header containing a
1805 .B blkinfo
1806 structure
1807 .B info
1808 (magic number 0xfebe), the
1809 .B count
1810 of active entries, and the
1811 .B level
1812 of this block above the leaves.
1813 .TP
1814 .B btree
1815 array of entries containing
1816 .B hashval
1817 and
1818 .B before
1819 fields. The
1820 .B before
1821 value is a block number within the directory file to the child block, the
1822 .B hashval
1823 is the last hash value in that block.
1824 .RE
1825 .IP
1826
1827 The leaf blocks have the following fields:
1828 .RS 1.4i
1829 .TP 1.2i
1830 .B hdr
1831 header containing a
1832 .B blkinfo
1833 structure
1834 .B info
1835 (magic number 0xfeeb), the
1836 .B count
1837 of active entries,
1838 .B namebytes
1839 (total name string bytes),
1840 .B holes
1841 flag (block needs compaction), and
1842 .B freemap
1843 (array of
1844 .BR base ", " size
1845 entries for free regions).
1846 .TP
1847 .B entries
1848 array of structures containing
1849 .BR hashval ,
1850 .B nameidx
1851 (byte index into the block of the name string), and
1852 .BR namelen .
1853 .TP
1854 .B namelist
1855 array of structures containing
1856 .B inumber
1857 and
1858 .BR name .
1859 .RE
1860 .PD
1861 .TP
1862 .B dir2
1863 A version 2 directory has four kinds of blocks.
1864 Data blocks start at offset 0 in the file.
1865 There are two kinds of data blocks: single-block directories have
1866 the leaf information embedded at the end of the block, data blocks
1867 in multi-block directories do not.
1868 Node and leaf blocks start at offset 32GiB (with either a single
1869 leaf block or the root node block).
1870 Freespace blocks start at offset 64GiB.
1871 The node and leaf blocks form a Btree, with references to the data
1872 in the data blocks.
1873 The freespace blocks form an index of longest free spaces within the
1874 data blocks.
1875 .IP
1876 A single-block directory block contains the following fields:
1877 .RS 1.4i
1878 .PD 0
1879 .TP 1.2i
1880 .B bhdr
1881 header containing
1882 .B magic
1883 number 0x58443242 ('XD2B') and an array
1884 .B bestfree
1885 of the longest 3 free spaces in the block
1886 .RB ( offset ", " length ).
1887 .TP
1888 .B bu
1889 array of union structures. Each element is either an entry or a freespace.
1890 For entries, there are the following fields:
1891 .BR inumber ,
1892 .BR namelen ,
1893 .BR name ,
1894 and
1895 .BR tag .
1896 For freespace, there are the following fields:
1897 .B freetag
1898 (0xffff),
1899 .BR length ,
1900 and
1901 .BR tag .
1902 The
1903 .B tag
1904 value is the byte offset in the block of the start of the entry it
1905 is contained in.
1906 .TP
1907 .B bleaf
1908 array of leaf entries containing
1909 .B hashval
1910 and
1911 .BR address .
1912 The
1913 .B address
1914 is a 64-bit word offset into the file.
1915 .TP
1916 .B btail
1917 tail structure containing the total
1918 .B count
1919 of leaf entries and
1920 .B stale
1921 count of unused leaf entries.
1922 .RE
1923 .IP
1924
1925 A data block contains the following fields:
1926 .RS 1.4i
1927 .TP 1.2i
1928 .B dhdr
1929 header containing
1930 .B magic
1931 number 0x58443244 ('XD2D') and an array
1932 .B bestfree
1933 of the longest 3 free spaces in the block
1934 .RB ( offset ", " length ).
1935 .TP
1936 .B du
1937 array of union structures as for
1938 .BR bu .
1939 .RE
1940 .IP
1941
1942 Leaf blocks have two possible forms. If the Btree consists of a single
1943 leaf then the freespace information is in the leaf block,
1944 otherwise it is in separate blocks and the root of the Btree is
1945 a node block. A leaf block contains the following fields:
1946 .RS 1.4i
1947 .TP 1.2i
1948 .B lhdr
1949 header containing a
1950 .B blkinfo
1951 structure
1952 .B info
1953 (magic number 0xd2f1 for the single leaf case, 0xd2ff for the true
1954 Btree case), the total
1955 .B count
1956 of leaf entries, and
1957 .B stale
1958 count of unused leaf entries.
1959 .TP
1960 .B lents
1961 leaf entries, as for
1962 .BR bleaf .
1963 .TP
1964 .B lbests
1965 [single leaf only] array of values which represent the longest freespace
1966 in each data block in the directory.
1967 .TP
1968 .B ltail
1969 [single leaf only] tail structure containing
1970 .B bestcount
1971 count of
1972 .BR lbests .
1973 .RE
1974 .IP
1975
1976 A node block is identical to that for types
1977 .B attr
1978 and
1979 .BR dir .
1980
1981 A freespace block contains the following fields:
1982 .RS 1.4i
1983 .TP 1.2i
1984 .B fhdr
1985 header containing
1986 .B magic
1987 number 0x58443246 ('XD2F'),
1988 .B firstdb
1989 first data block number covered by this freespace block,
1990 .B nvalid
1991 number of valid entries, and
1992 .B nused
1993 number of entries representing real data blocks.
1994 .TP
1995 .B fbests
1996 array of values as for
1997 .BR lbests .
1998 .PD
1999 .RE
2000 .TP
2001 .B dqblk
2002 The quota information is stored in files referred to by the superblock
2003 .B uquotino
2004 and
2005 .B pquotino
2006 fields. Each filesystem block in a quota file contains a constant number of
2007 quota entries. The quota entry size is currently 136 bytes, so with a 4KiB
2008 filesystem block size there are 30 quota entries per block. The
2009 .B dquot
2010 command is used to locate these entries in the filesystem.
2011 The file entries are indexed by the user or project identifier
2012 to determine the block and offset.
2013 Each quota entry has the following fields:
2014 .RS 1.4i
2015 .PD 0
2016 .TP 1.5i
2017 .B magic
2018 magic number, 0x4451 ('DQ').
2019 .TP
2020 .B version
2021 version number, currently 1.
2022 .TP
2023 .B flags
2024 flags, values include 0x01 for user quota, 0x02 for project quota.
2025 .TP
2026 .B id
2027 user or project identifier.
2028 .TP
2029 .B blk_hardlimit
2030 absolute limit on blocks in use.
2031 .TP
2032 .B blk_softlimit
2033 preferred limit on blocks in use.
2034 .TP
2035 .B ino_hardlimit
2036 absolute limit on inodes in use.
2037 .TP
2038 .B ino_softlimit
2039 preferred limit on inodes in use.
2040 .TP
2041 .B bcount
2042 blocks actually in use.
2043 .TP
2044 .B icount
2045 inodes actually in use.
2046 .TP
2047 .B itimer
2048 time when service will be refused if soft limit is violated for inodes.
2049 .TP
2050 .B btimer
2051 time when service will be refused if soft limit is violated for blocks.
2052 .TP
2053 .B iwarns
2054 number of warnings issued about inode limit violations.
2055 .TP
2056 .B bwarns
2057 number of warnings issued about block limit violations.
2058 .TP
2059 .B rtb_hardlimit
2060 absolute limit on realtime blocks in use.
2061 .TP
2062 .B rtb_softlimit
2063 preferred limit on realtime blocks in use.
2064 .TP
2065 .B rtbcount
2066 realtime blocks actually in use.
2067 .TP
2068 .B rtbtimer
2069 time when service will be refused if soft limit is violated for realtime blocks.
2070 .TP
2071 .B rtbwarns
2072 number of warnings issued about realtime block limit violations.
2073 .PD
2074 .RE
2075 .TP
2076 .B inobt
2077 There is one set of filesystem blocks forming the inode allocation Btree for
2078 each allocation group. The root block of this Btree is designated by the
2079 .B root
2080 field in the corresponding AGI block.
2081 The blocks are linked to sibling left and right blocks at each level,
2082 as well as by pointers from parent to child blocks.
2083 Each block has the following fields:
2084 .RS 1.4i
2085 .PD 0
2086 .TP 1.2i
2087 .B magic
2088 INOBT block magic number, 0x49414254 ('IABT').
2089 .TP
2090 .B level
2091 level number of this block, 0 is a leaf.
2092 .TP
2093 .B numrecs
2094 number of data entries in the block.
2095 .TP
2096 .B leftsib
2097 left (logically lower) sibling block, 0 if none.
2098 .TP
2099 .B rightsib
2100 right (logically higher) sibling block, 0 if none.
2101 .TP
2102 .B recs
2103 [leaf blocks only] array of inode records. Each record contains
2104 .B startino
2105 allocation-group relative inode number,
2106 .B freecount
2107 count of free inodes in this chunk, and
2108 .B free
2109 bitmap, LSB corresponds to inode 0.
2110 .TP
2111 .B keys
2112 [non-leaf blocks only] array of key records. These are the first value of each
2113 block in the level below this one. Each record contains
2114 .BR startino .
2115 .TP
2116 .B ptrs
2117 [non-leaf blocks only] array of child block pointers. Each pointer is a
2118 block number within the allocation group to the next level in the Btree.
2119 .PD
2120 .RE
2121 .TP
2122 .B inode
2123 Inodes are allocated in "chunks" of 64 inodes each. Usually a chunk is
2124 multiple filesystem blocks, although there are cases with large filesystem
2125 blocks where a chunk is less than one block. The inode Btree (see
2126 .B inobt
2127 above) refers to the inode numbers per allocation group. The inode numbers
2128 directly reflect the location of the inode block on disk. Use the
2129 .B inode
2130 command to point
2131 .B xfs_db
2132 to a specific inode. Each inode contains four regions:
2133 .BR core ,
2134 .BR next_unlinked ,
2135 .BR u ", and "
2136 .BR a .
2137 .B core
2138 contains the fixed information.
2139 .B next_unlinked
2140 is separated from the core due to journaling considerations, see type
2141 .B agi
2142 field
2143 .BR unlinked .
2144 .B u
2145 is a union structure that is different in size and format depending
2146 on the type and representation of the file data ("data fork").
2147 .B a
2148 is an optional union structure to describe attribute data,
2149 that is different in size, format, and location depending on the presence
2150 and representation of attribute data, and the size of the
2151 .B u
2152 data ("attribute fork").
2153 .B xfs_db
2154 automatically selects the proper union members based on information
2155 in the inode.
2156 .IP
2157 The following are fields in the inode core:
2158 .RS 1.4i
2159 .PD 0
2160 .TP 1.2i
2161 .B magic
2162 inode magic number, 0x494e ('IN').
2163 .TP
2164 .B mode
2165 mode and type of file, as described in
2166 .BR chmod (2),
2167 .BR mknod (2),
2168 and
2169 .BR stat (2).
2170 .TP
2171 .B version
2172 inode version, 1 or 2.
2173 .TP
2174 .B format
2175 format of
2176 .B u
2177 union data (0: xfs_dev_t, 1: local file \- in-inode directory or symlink,
2178 2: extent list, 3: Btree root, 4: unique id [unused]).
2179 .TP
2180 .B nlinkv1
2181 number of links to the file in a version 1 inode.
2182 .TP
2183 .B nlinkv2
2184 number of links to the file in a version 2 inode.
2185 .TP
2186 .B projid_lo
2187 owner's project id (low word; version 2 inode only).
2188 .B projid_hi
2189 owner's project id (high word; version 2 inode only).
2190 .TP
2191 .B uid
2192 owner's user id.
2193 .TP
2194 .B gid
2195 owner's group id.
2196 .TP
2197 .B atime
2198 time last accessed (seconds and nanoseconds).
2199 .TP
2200 .B mtime
2201 time last modified.
2202 .TP
2203 .B ctime
2204 time created or inode last modified.
2205 .TP
2206 .B size
2207 number of bytes in the file.
2208 .TP
2209 .B nblocks
2210 total number of blocks in the file including indirect and attribute.
2211 .TP
2212 .B extsize
2213 basic/minimum extent size for the file.
2214 .TP
2215 .B nextents
2216 number of extents in the data fork.
2217 .TP
2218 .B naextents
2219 number of extents in the attribute fork.
2220 .TP
2221 .B forkoff
2222 attribute fork offset in the inode, in 64-bit words from the start of
2223 .BR u .
2224 .TP
2225 .B aformat
2226 format of
2227 .B a
2228 data (1: local attribute data, 2: extent list, 3: Btree root).
2229 .TP
2230 .B dmevmask
2231 DMAPI event mask.
2232 .TP
2233 .B dmstate
2234 DMAPI state information.
2235 .TP
2236 .B newrtbm
2237 file is the realtime bitmap and is "new" format.
2238 .TP
2239 .B prealloc
2240 file has preallocated data space after EOF.
2241 .TP
2242 .B realtime
2243 file data is in the realtime subvolume.
2244 .TP
2245 .B gen
2246 inode generation number.
2247 .RE
2248 .IP
2249
2250 The following fields are in the
2251 .B u
2252 data fork union:
2253 .RS 1.4i
2254 .TP 1.2i
2255 .B bmbt
2256 bmap Btree root. This looks like a
2257 .B bmapbtd
2258 block with redundant information removed.
2259 .TP
2260 .B bmx
2261 array of extent descriptors.
2262 .TP
2263 .B dev
2264 dev_t for the block or character device.
2265 .TP
2266 .B sfdir
2267 shortform (in-inode) version 1 directory. This consists of a
2268 .B hdr
2269 containing the
2270 .B parent
2271 inode number and a
2272 .B count
2273 of active entries in the directory, followed by an array
2274 .B list
2275 of
2276 .B hdr.count
2277 entries. Each such entry contains
2278 .BR inumber ,
2279 .BR namelen ,
2280 and
2281 .B name
2282 string.
2283 .TP
2284 .B sfdir2
2285 shortform (in-inode) version 2 directory. This consists of a
2286 .B hdr
2287 containing a
2288 .B count
2289 of active entries in the directory, an
2290 .B i8count
2291 of entries with inumbers that don't fit in a 32-bit value, and the
2292 .B parent
2293 inode number, followed by an array
2294 .B list
2295 of
2296 .B hdr.count
2297 entries. Each such entry contains
2298 .BR namelen ,
2299 a saved
2300 .B offset
2301 used when the directory is converted to a larger form, a
2302 .B name
2303 string, and the
2304 .BR inumber .
2305 .TP
2306 .B symlink
2307 symbolic link string value.
2308 .RE
2309 .IP
2310
2311 The following fields are in the
2312 .B a
2313 attribute fork union if it exists:
2314 .RS 1.4i
2315 .TP 1.2i
2316 .B bmbt
2317 bmap Btree root, as above.
2318 .TP
2319 .B bmx
2320 array of extent descriptors.
2321 .TP
2322 .B sfattr
2323 shortform (in-inode) attribute values. This consists of a
2324 .B hdr
2325 containing a
2326 .B totsize
2327 (total size in bytes) and a
2328 .B count
2329 of active entries, followed by an array
2330 .B list
2331 of
2332 .B hdr.count
2333 entries. Each such entry contains
2334 .BR namelen ,
2335 .BR valuelen ,
2336 .BR root
2337 flag,
2338 .BR name ,
2339 and
2340 .BR value .
2341 .PD
2342 .RE
2343 .TP
2344 .B log
2345 Log blocks contain the journal entries for XFS.
2346 It's not useful to examine these with
2347 .BR xfs_db ,
2348 use
2349 .BR xfs_logprint (8)
2350 instead.
2351 .TP
2352 .B refcntbt
2353 There is one set of filesystem blocks forming the reference count Btree for
2354 each allocation group. The root block of this Btree is designated by the
2355 .B refcntroot
2356 field in the corresponding AGF block. The blocks are linked to sibling left
2357 and right blocks at each level, as well as by pointers from parent to child
2358 blocks. Each block has the following fields:
2359 .RS 1.4i
2360 .PD 0
2361 .TP 1.2i
2362 .B magic
2363 REFC block magic number, 0x52334643 ('R3FC').
2364 .TP
2365 .B level
2366 level number of this block, 0 is a leaf.
2367 .TP
2368 .B numrecs
2369 number of data entries in the block.
2370 .TP
2371 .B leftsib
2372 left (logically lower) sibling block, 0 if none.
2373 .TP
2374 .B rightsib
2375 right (logically higher) sibling block, 0 if none.
2376 .TP
2377 .B recs
2378 [leaf blocks only] array of reference count records. Each record contains
2379 .BR startblock ,
2380 .BR blockcount ,
2381 and
2382 .BR refcount .
2383 .TP
2384 .B keys
2385 [non-leaf blocks only] array of key records. These are the first value
2386 of each block in the level below this one. Each record contains
2387 .BR startblock .
2388 .TP
2389 .B ptrs
2390 [non-leaf blocks only] array of child block pointers. Each pointer is a
2391 block number within the allocation group to the next level in the Btree.
2392 .PD
2393 .RE
2394 .TP
2395 .B rmapbt
2396 There is one set of filesystem blocks forming the reverse mapping Btree for
2397 each allocation group. The root block of this Btree is designated by the
2398 .B rmaproot
2399 field in the corresponding AGF block. The blocks are linked to sibling left
2400 and right blocks at each level, as well as by pointers from parent to child
2401 blocks. Each block has the following fields:
2402 .RS 1.4i
2403 .PD 0
2404 .TP 1.2i
2405 .B magic
2406 RMAP block magic number, 0x524d4233 ('RMB3').
2407 .TP
2408 .B level
2409 level number of this block, 0 is a leaf.
2410 .TP
2411 .B numrecs
2412 number of data entries in the block.
2413 .TP
2414 .B leftsib
2415 left (logically lower) sibling block, 0 if none.
2416 .TP
2417 .B rightsib
2418 right (logically higher) sibling block, 0 if none.
2419 .TP
2420 .B recs
2421 [leaf blocks only] array of reference count records. Each record contains
2422 .BR startblock ,
2423 .BR blockcount ,
2424 .BR owner ,
2425 .BR offset ,
2426 .BR attr_fork ,
2427 .BR bmbt_block ,
2428 and
2429 .BR unwritten .
2430 .TP
2431 .B keys
2432 [non-leaf blocks only] array of double-key records. The first ("low") key
2433 contains the first value of each block in the level below this one. The second
2434 ("high") key contains the largest key that can be used to identify any record
2435 in the subtree. Each record contains
2436 .BR startblock ,
2437 .BR owner ,
2438 .BR offset ,
2439 .BR attr_fork ,
2440 and
2441 .BR bmbt_block .
2442 .TP
2443 .B ptrs
2444 [non-leaf blocks only] array of child block pointers. Each pointer is a
2445 block number within the allocation group to the next level in the Btree.
2446 .PD
2447 .RE
2448 .TP
2449 .B rtbitmap
2450 If the filesystem has a realtime subvolume, then the
2451 .B rbmino
2452 field in the superblock refers to a file that contains the realtime bitmap.
2453 Each bit in the bitmap file controls the allocation of a single realtime extent
2454 (set == free). The bitmap is processed in 32-bit words, the LSB of a word is
2455 used for the first extent controlled by that bitmap word. The
2456 .B atime
2457 field of the realtime bitmap inode contains a counter
2458 that is used to control where the next new realtime file will start.
2459 .TP
2460 .B rtsummary
2461 If the filesystem has a realtime subvolume, then the
2462 .B rsumino
2463 field in the superblock refers to a file that contains the realtime summary
2464 data. The summary file contains a two-dimensional array of 16-bit values.
2465 Each value counts the number of free extent runs
2466 (consecutive free realtime extents)
2467 of a given range of sizes that starts in a given bitmap block.
2468 The size ranges are binary buckets (low size in the bucket is a power of 2).
2469 There are as many size ranges as are necessary given the size of the
2470 realtime subvolume.
2471 The first dimension is the size range,
2472 the second dimension is the starting bitmap block number
2473 (adjacent entries are for the same size, adjacent bitmap blocks).
2474 .TP
2475 .B sb
2476 There is one sb (superblock) structure per allocation group.
2477 It is the first disk block in the allocation group.
2478 Only the first one (block 0 of the filesystem) is actually used;
2479 the other blocks are redundant information for
2480 .BR xfs_repair (8)
2481 to use if the first superblock is damaged. Fields defined:
2482 .RS 1.4i
2483 .PD 0
2484 .TP 1.2i
2485 .B magicnum
2486 superblock magic number, 0x58465342 ('XFSB').
2487 .TP
2488 .B blocksize
2489 filesystem block size in bytes.
2490 .TP
2491 .B dblocks
2492 number of filesystem blocks present in the data subvolume.
2493 .TP
2494 .B rblocks
2495 number of filesystem blocks present in the realtime subvolume.
2496 .TP
2497 .B rextents
2498 number of realtime extents that
2499 .B rblocks
2500 contain.
2501 .TP
2502 .B uuid
2503 unique identifier of the filesystem.
2504 .TP
2505 .B logstart
2506 starting filesystem block number of the log (journal).
2507 If this value is 0 the log is "external".
2508 .TP
2509 .B rootino
2510 root inode number.
2511 .TP
2512 .B rbmino
2513 realtime bitmap inode number.
2514 .TP
2515 .B rsumino
2516 realtime summary data inode number.
2517 .TP
2518 .B rextsize
2519 realtime extent size in filesystem blocks.
2520 .TP
2521 .B agblocks
2522 size of an allocation group in filesystem blocks.
2523 .TP
2524 .B agcount
2525 number of allocation groups.
2526 .TP
2527 .B rbmblocks
2528 number of realtime bitmap blocks.
2529 .TP
2530 .B logblocks
2531 number of log blocks (filesystem blocks).
2532 .TP
2533 .B versionnum
2534 filesystem version information.
2535 This value is currently 1, 2, 3, or 4 in the low 4 bits.
2536 If the low bits are 4 then the other bits have additional meanings.
2537 1 is the original value.
2538 2 means that attributes were used.
2539 3 means that version 2 inodes (large link counts) were used.
2540 4 is the bitmask version of the version number.
2541 In this case, the other bits are used as flags
2542 (0x0010: attributes were used,
2543 0x0020: version 2 inodes were used,
2544 0x0040: quotas were used,
2545 0x0080: inode cluster alignment is in force,
2546 0x0100: data stripe alignment is in force,
2547 0x0200: the
2548 .B shared_vn
2549 field is used,
2550 0x1000: unwritten extent tracking is on,
2551 0x2000: version 2 directories are in use).
2552 .TP
2553 .B sectsize
2554 sector size in bytes, currently always 512.
2555 This is the size of the superblock and the other header blocks.
2556 .TP
2557 .B inodesize
2558 inode size in bytes.
2559 .TP
2560 .B inopblock
2561 number of inodes per filesystem block.
2562 .TP
2563 .B fname
2564 obsolete, filesystem name.
2565 .TP
2566 .B fpack
2567 obsolete, filesystem pack name.
2568 .TP
2569 .B blocklog
2570 log2 of
2571 .BR blocksize .
2572 .TP
2573 .B sectlog
2574 log2 of
2575 .BR sectsize .
2576 .TP
2577 .B inodelog
2578 log2 of
2579 .BR inodesize .
2580 .TP
2581 .B inopblog
2582 log2 of
2583 .BR inopblock .
2584 .TP
2585 .B agblklog
2586 log2 of
2587 .B agblocks
2588 (rounded up).
2589 .TP
2590 .B rextslog
2591 log2 of
2592 .BR rextents .
2593 .TP
2594 .B inprogress
2595 .BR mkfs.xfs (8)
2596 or
2597 .BR xfs_copy (8)
2598 aborted before completing this filesystem.
2599 .TP
2600 .B imax_pct
2601 maximum percentage of filesystem space used for inode blocks.
2602 .TP
2603 .B icount
2604 number of allocated inodes.
2605 .TP
2606 .B ifree
2607 number of allocated inodes that are not in use.
2608 .TP
2609 .B fdblocks
2610 number of free data blocks.
2611 .TP
2612 .B frextents
2613 number of free realtime extents.
2614 .TP
2615 .B uquotino
2616 user quota inode number.
2617 .TP
2618 .B pquotino
2619 project quota inode number; this is currently unused.
2620 .TP
2621 .B qflags
2622 quota status flags
2623 (0x01: user quota accounting is on,
2624 0x02: user quota limits are enforced,
2625 0x04: quotacheck has been run on user quotas,
2626 0x08: project quota accounting is on,
2627 0x10: project quota limits are enforced,
2628 0x20: quotacheck has been run on project quotas).
2629 .TP
2630 .B flags
2631 random flags. 0x01: only read-only mounts are allowed.
2632 .TP
2633 .B shared_vn
2634 shared version number (shared readonly filesystems).
2635 .TP
2636 .B inoalignmt
2637 inode chunk alignment in filesystem blocks.
2638 .TP
2639 .B unit
2640 stripe or RAID unit.
2641 .TP
2642 .B width
2643 stripe or RAID width.
2644 .TP
2645 .B dirblklog
2646 log2 of directory block size (filesystem blocks).
2647 .PD
2648 .RE
2649 .TP
2650 .B symlink
2651 Symbolic link blocks are used only when the symbolic link value does
2652 not fit inside the inode. The block content is just the string value.
2653 Bytes past the logical end of the symbolic link value have arbitrary values.
2654 .TP
2655 .B text
2656 User file blocks, and other blocks whose type is unknown,
2657 have this type for display purposes in
2658 .BR xfs_db .
2659 The block data is displayed in two columns: Hexadecimal format
2660 and printable ASCII chars.
2661 .SH DIAGNOSTICS
2662 Many messages can come from the
2663 .B blockget
2664 command.
2665 If the filesystem is completely corrupt, a core dump might
2666 be produced instead of the message
2667 .RS
2668 .I device
2669 .B is not a valid filesystem
2670 .RE
2671 .PP
2672 If the filesystem is very large (has many files) then
2673 .B blockget
2674 might run out of memory. In this case the message
2675 .RS
2676 .B out of memory
2677 .RE
2678 is printed.
2679 .PP
2680 The following is a description of the most likely problems and the associated
2681 messages.
2682 Most of the diagnostics produced are only meaningful with an understanding
2683 of the structure of the filesystem.
2684 .TP
2685 .BI "agf_freeblks " n ", counted " m " in ag " a
2686 The freeblocks count in the allocation group header for allocation group
2687 .I a
2688 doesn't match the number of blocks counted free.
2689 .TP
2690 .BI "agf_longest " n ", counted " m " in ag " a
2691 The longest free extent in the allocation group header for allocation group
2692 .I a
2693 doesn't match the longest free extent found in the allocation group.
2694 .TP
2695 .BI "agi_count " n ", counted " m " in ag " a
2696 The allocated inode count in the allocation group header for allocation group
2697 .I a
2698 doesn't match the number of inodes counted in the allocation group.
2699 .TP
2700 .BI "agi_freecount " n ", counted " m " in ag " a
2701 The free inode count in the allocation group header for allocation group
2702 .I a
2703 doesn't match the number of inodes counted free in the allocation group.
2704 .TP
2705 .BI "block " a/b " expected inum 0 got " i
2706 The block number is specified as a pair
2707 (allocation group number, block in the allocation group).
2708 The block is used multiple times (shared), between multiple inodes.
2709 This message usually follows a message of the next type.
2710 .TP
2711 .BI "block " a/b " expected type unknown got " y
2712 The block is used multiple times (shared).
2713 .TP
2714 .BI "block " a/b " type unknown not expected
2715 .SH SEE ALSO
2716 .BR mkfs.xfs (8),
2717 .BR xfs_admin (8),
2718 .BR xfs_copy (8),
2719 .BR xfs_logprint (8),
2720 .BR xfs_metadump (8),
2721 .BR xfs_ncheck (8),
2722 .BR xfs_repair (8),
2723 .BR mount (8),
2724 .BR chmod (2),
2725 .BR mknod (2),
2726 .BR stat (2),
2727 .BR xfs (5).