1xfs_db(8)                   System Manager's Manual                  xfs_db(8)
2
3
4

NAME

6       xfs_db - debug an XFS filesystem
7

SYNOPSIS

9       xfs_db [ -c cmd ] ... [ -i|r|x|F ] [ -f ] [ -l logdev ] [ -p progname ]
10       device
11       xfs_db -V
12

DESCRIPTION

14       xfs_db is used to examine an XFS filesystem. Under  rare  circumstances
15       it  can also be used to modify an XFS filesystem, but that task is nor‐
16       mally left to xfs_repair(8) or to scripts such as xfs_admin(8) that run
17       xfs_db.
18

OPTIONS

20       -c cmd xfs_db commands may be run interactively (the default) or as ar‐
21              guments on the command line. Multiple -c arguments may be given.
22              The commands are run in the sequence given, then the program ex‐
23              its.
24
25       -f     Specifies that the filesystem image to be processed is stored in
26              a  regular  file at device (see the mkfs.xfs(8) -d file option).
27              This might happen if an image copy of a filesystem has been made
28              into an ordinary file with xfs_copy(8).
29
30       -F     Specifies  that we want to continue even if the superblock magic
31              is not correct.  For use in xfs_metadump.
32
33       -i     Allows execution on a mounted filesystem, provided it is mounted
34              read-only.   Useful for shell scripts which must only operate on
35              filesystems in a guaranteed consistent state  (either  unmounted
36              or mounted read-only). These semantics are slightly different to
37              that of the -r option.
38
39       -l logdev
40              Specifies the device where the filesystems external log resides.
41              Only  for  those  filesystems which use an external log. See the
42              mkfs.xfs(8) -l option, and refer to xfs(5) for  a  detailed  de‐
43              scription of the XFS log.
44
45       -p progname
46              Set the program name to progname for prompts and some error mes‐
47              sages, the default value is xfs_db.
48
49       -r     Open device or filename read-only. This option  is  required  if
50              the  filesystem  is  mounted.  It is only necessary to omit this
51              flag if a command that changes data (write, blocktrash, crc)  is
52              to be used.
53
54       -x     Specifies expert mode.  This enables the (write, blocktrash, crc
55              invalidate/revalidate) commands.
56
57       -V     Prints the version number and exits.
58

CONCEPTS

60       xfs_db commands can be broken up into two classes.  Most  commands  are
61       for  the  navigation  and display of data structures in the filesystem.
62       Other commands are for scanning the filesystem in some way.
63
64       Commands which are used to navigate the filesystem structure take argu‐
65       ments  which  reflect  the names of filesystem structure fields.  There
66       can be multiple field names  separated  by  dots  when  the  underlying
67       structures  are nested, as in C.  The field names can be indexed (as an
68       array index) if the underlying field is an array.   The  array  indices
69       can be specified as a range, two numbers separated by a dash.
70
71       xfs_db  maintains a current address in the filesystem.  The granularity
72       of the address is a filesystem structure.  This  can  be  a  filesystem
73       block, an inode or quota (smaller than a filesystem block), or a direc‐
74       tory block (could be larger than a filesystem block).  There are a  va‐
75       riety of commands to set the current address.  Associated with the cur‐
76       rent address is the current data type, which is the structural type  of
77       this  data.   Commands which follow the structure of the filesystem al‐
78       ways set the type as well  as  the  address.   Commands  which  examine
79       pieces  of an individual file (inode) need the current inode to be set,
80       this is done with the inode command.
81
82       The current address/type information is actually maintained in a  stack
83       that  can  be explicitly manipulated with the push, pop, and stack com‐
84       mands.  This allows for easy examination of a nested filesystem  struc‐
85       ture.   Also,  the  last several locations visited are stored in a ring
86       buffer which can be manipulated with the forward, back, and  ring  com‐
87       mands.
88
89       XFS  filesystems  are divided into a small number of allocation groups.
90       xfs_db maintains a notion of the current allocation group which is  ma‐
91       nipulated by some commands. The initial allocation group is 0.
92

COMMANDS

94       Many commands have extensive online help. Use the help command for more
95       details on any command.
96
97       a      See the addr command.
98
99       ablock filoff
100              Set current address to the offset  filoff  (a  filesystem  block
101              number) in the attribute area of the current inode.
102
103       addr [field-expression]
104              Set  current address to the value of the field-expression.  This
105              is used to "follow" a reference in one structure to  the  object
106              being  referred to. If no argument is given, the current address
107              is printed.
108
109       agf [agno]
110              Set current address to the AGF block for allocation group  agno.
111              If no argument is given, use the current allocation group.
112
113       agfl [agno]
114              Set current address to the AGFL block for allocation group agno.
115              If no argument is given, use the current allocation group.
116
117       agi [agno]
118              Set current address to the AGI block for allocation group  agno.
119              If no argument is given, use the current allocation group.
120
121       agresv [agno]
122              Displays  the length, free block count, per-AG reservation size,
123              and per-AG reservation usage for a given AG.  If no argument  is
124              given, display information for all AGs.
125
126       attr_remove [-r|-u|-s] [-n] name
127              Remove the specified extended attribute from the current file.
128
129                 -r  Sets the attribute in the root namespace.  Only one name‐
130                     space option can be specified.
131
132                 -u  Sets the attribute in the user namespace.  Only one name‐
133                     space option can be specified.
134
135                 -s  Sets  the  attribute  in  the secure namespace.  Only one
136                     namespace option can be specified.
137
138                 -n  Do not enable 'noattr2' mode on V4 filesystems.
139
140       attr_set [-r|-u|-s] [-n] [-R|-C] [-v namelen] name
141              Sets an extended attribute on the current file  with  the  given
142              name.
143
144                 -r  Sets the attribute in the root namespace.  Only one name‐
145                     space option can be specified.
146
147                 -u  Sets the attribute in the user namespace.  Only one name‐
148                     space option can be specified.
149
150                 -s  Sets  the  attribute  in  the secure namespace.  Only one
151                     namespace option can be specified.
152
153                 -n  Do not enable 'noattr2' mode on V4 filesystems.
154
155                 -R  Replace the attribute.  The command will fail if the  at‐
156                     tribute does not already exist.
157
158                 -C  Create  the  attribute.  The command will fail if the at‐
159                     tribute already exists.
160
161                 -v  Set the attribute value to a string of this  length  con‐
162                     taining the letter 'v'.
163
164       b      See the back command.
165
166       back   Move to the previous location in the position ring.
167
168       blockfree
169              Free  block usage information collected by the last execution of
170              the blockget command. This must be done before another  blockget
171              command  can  be given, presumably with different arguments than
172              the previous one.
173
174       blockget [-npvs] [-b bno] ... [-i ino] ...
175              Get block usage and check filesystem consistency.  The  informa‐
176              tion  is  saved  for  use  by  a subsequent blockuse, ncheck, or
177              blocktrash command.
178
179                 -b  is used to specify filesystem block numbers  about  which
180                     verbose information should be printed.
181
182                 -i  is  used to specify inode numbers about which verbose in‐
183                     formation should be printed.
184
185                 -n  is used to save pathnames for  inodes  visited,  this  is
186                     used  to support the xfs_ncheck(8) command. It also means
187                     that pathnames will be printed for inodes that have prob‐
188                     lems.  This option uses a lot of memory so is not enabled
189                     by default.
190
191                 -p  causes error messages to be prefixed with the  filesystem
192                     name being processed. This is useful if several copies of
193                     xfs_db are run in parallel.
194
195                 -s  restricts output to severe errors only. This is useful if
196                     the output is too long otherwise.
197
198                 -v  enables  verbose output. Messages will be printed for ev‐
199                     ery block and inode processed.
200
201       blocktrash [-z] [-o offset] [-n count] [-x  min]  [-y  max]  [-s  seed]
202       [-0|1|2|3] [-t type] ...
203              Trash  randomly  selected  filesystem metadata blocks.  Trashing
204              occurs to randomly selected bits in  the  chosen  blocks.   This
205              command  is  available only in debugging versions of xfs_db.  It
206              is useful for testing xfs_repair(8).
207
208                 -0 | -1 | -2 | -3
209                     These are used to set the operating mode for  blocktrash.
210                     Only  one  can  be  used: -0 changed bits are cleared; -1
211                     changed bits are set; -2 changed bits  are  inverted;  -3
212                     changed bits are randomized.
213
214                 -n  supplies the count of block-trashings to perform (default
215                     1).
216
217                 -o  supplies the bit offset at which to  start  trashing  the
218                     block.   If  the value is preceded by a '+', the trashing
219                     will start at a randomly chosen  offset  that  is  larger
220                     than  the  value  supplied.   The  default is to randomly
221                     choose an offset anywhere in the block.
222
223                 -s  supplies a seed to the random processing.
224
225                 -t  gives a type of blocks to be selected for trashing.  Mul‐
226                     tiple -t options may be given. If no -t options are given
227                     then all metadata types can be trashed.
228
229                 -x  sets the minimum size of bit range to be trashed. The de‐
230                     fault value is 1.
231
232                 -y  sets the maximum size of bit range to be trashed. The de‐
233                     fault value is 1024.
234
235                 -z  trashes the block at the top of the  stack.   It  is  not
236                     necessary to run blockget if this option is supplied.
237
238       blockuse [-n] [-c count]
239              Print  usage  for  current filesystem block(s).  For each block,
240              the type and (if any) inode are printed.
241
242                 -c  specifies a count of blocks to process. The default value
243                     is 1 (the current block only).
244
245                 -n  specifies  that  file  names should be printed. The prior
246                     blockget command must have also specified the -n option.
247
248       bmap [-a] [-d] [block [len]]
249              Show the block map for the current inode.  The map  display  can
250              be  restricted to an area of the file with the block and len ar‐
251              guments. If block is given and len is omitted then 1 is  assumed
252              for len.
253
254              The  -a  and -d options are used to select the attribute or data
255              area of the inode, if neither option is given  then  both  areas
256              are shown.
257
258       btdump [-a] [-i]
259              If  the  cursor points to a btree node, dump the btree from that
260              block downward.  If instead the cursor points to an inode,  dump
261              the  data fork block mapping btree if there is one.  If the cur‐
262              sor points to a directory or extended attribute btree node, dump
263              that.  By default, only records stored in the btree are dumped.
264
265                 -a  If  the  cursor points at an inode, dump the extended at‐
266                     tribute block mapping btree, if present.
267
268                 -i  Dump all keys and pointers in intermediate  btree  nodes,
269                     and all records in leaf btree nodes.
270
271       btheight [-b blksz] [-n recs] [-w max|min|absmax] btree types...
272              For a given number of btree records and a btree type, report the
273              number of records and blocks for each level of  the  btree,  and
274              the  total number of blocks.  The btree type must be given after
275              the options.
276
277              A  raw  btree  geometry  can   be   provided   in   the   format
278              "record_bytes:key_bytes:ptr_bytes:header_type",            where
279              header_type is one of "short", "long", "shortcrc", or "longcrc".
280
281              The supported btree types  are:  bnobt,  cntbt,  inobt,  finobt,
282              bmapbt, refcountbt, and rmapbt.  The magic value all can be used
283              to walk through all btree types.
284
285              Options are as follows:
286
287                 -b  is used to override the btree block size.  The default is
288                     the filesystem block size.
289
290                 -n  is  used to specify the number of records to store.  This
291                     argument is required.
292
293                 -w absmax
294                     shows the maximum possible height  for  the  given  btree
295                     types.
296
297                 -w max
298                     shows  only  the  best  case  scenario, which is when the
299                     btree blocks are maximally loaded.
300
301                 -w min
302                     shows only the worst case scenario,  which  is  when  the
303                     btree blocks are half full.
304
305       check  See the blockget command.
306
307       convert type number [type number] ... type
308              Convert from one address form to another.  The known types, with
309              alternate names, are:
310                 agblock or  agbno  (filesystem  block  within  an  allocation
311                        group)
312                 agino or aginode (inode number within an allocation group)
313                 agnumber or agno (allocation group number)
314                 bboff or daddroff (byte offset in a daddr)
315                 blkoff  or  fsboff or agboff (byte offset in a agblock or fs‐
316                        block)
317                 byte or fsbyte (byte address in filesystem)
318                 daddr or bb (disk address, 512-byte blocks)
319                 fsblock or fsb or fsbno (filesystem block,  see  the  fsblock
320                        command)
321                 ino or inode (inode number)
322                 inoidx or offset (index of inode in filesystem block)
323                 inooff or inodeoff (byte offset in inode)
324
325              Only  conversions  that  "make sense" are allowed.  The compound
326              form (with more than three arguments) is useful for  conversions
327              such as convert agno ag agbno agb fsblock.
328
329       crc [-i|-r|-v]
330              Invalidates,  revalidates, or validates the CRC (checksum) field
331              of the current structure, if it has one.  This command is avail‐
332              able only on CRC-enabled filesystems.  With no argument, valida‐
333              tion is performed.  Each command will display the resulting  CRC
334              value and state.
335
336                 -i  Invalidate  the structure's CRC value (incrementing it by
337                     one), and write it to disk.
338
339                 -r  Recalculate the current structure's  correct  CRC  value,
340                     and write it to disk.
341
342                 -v  Validate  and  display the current value and state of the
343                     structure's CRC.
344
345       daddr [d]
346              Set current address to the daddr (512 byte block)  given  by  d.
347              If  no value for d is given, the current address is printed, ex‐
348              pressed as a daddr.  The type is set to data (uninterpreted).
349
350       dblock filoff
351              Set current address to the offset  filoff  (a  filesystem  block
352              number) in the data area of the current inode.
353
354       debug [flagbits]
355              Set  debug option bits. These are used for debugging xfs_db.  If
356              no value is given for flagbits, print the current  debug  option
357              bits. These are for the use of the implementor.
358
359       dquot [-g|-p|-u] id
360              Set  current address to a group, project or user quota block for
361              the given ID. Defaults to user quota.
362
363       echo [arg] ...
364              Echo the arguments to the output.
365
366       f      See the forward command.
367
368       forward
369              Move forward to the next entry in the position ring.
370
371       frag [-adflqRrv]
372              Get file fragmentation data. This prints information about frag‐
373              mentation of file data in the filesystem (as opposed to fragmen‐
374              tation of freespace, for which see the  freesp  command).  Every
375              file in the filesystem is examined to see how far from ideal its
376              extent mappings are. A summary is printed giving the totals.
377
378                 -v  sets verbosity, every inode has information  printed  for
379                     it.   The  remaining  options select which inodes and ex‐
380                     tents are examined.  If no options are given then all are
381                     assumed set, otherwise just those given are enabled.
382
383                 -a  enables processing of attribute data.
384
385                 -d  enables processing of directory data.
386
387                 -f  enables processing of regular file data.
388
389                 -l  enables processing of symbolic link data.
390
391                 -q  enables processing of quota file data.
392
393                 -R  enables processing of realtime control file data.
394
395                 -r  enables processing of realtime file data.
396
397       freesp [-bcds] [-A alignment] [-a ag] ... [-e i] [-h h1] ... [-m m]
398              Summarize free space for the filesystem. The free blocks are ex‐
399              amined and totalled, and displayed in the form of  a  histogram,
400              with a count of extents in each range of free extent sizes.
401
402                 -A  reports only free extents with starting blocks aligned to
403                     alignment blocks.
404
405                 -a  adds ag to the list of allocation groups to be processed.
406                     If no -a options are given then all allocation groups are
407                     processed.
408
409                 -b  specifies that the histogram  buckets  are  binary-sized,
410                     with the starting sizes being the powers of 2.
411
412                 -c  specifies that freesp will search the by-size (cnt) space
413                     Btree instead of the default by-block (bno) space Btree.
414
415                 -d  specifies that every free extent will be displayed.
416
417                 -e  specifies that the  histogram  buckets  are  equal-sized,
418                     with the size specified as i.
419
420                 -h  specifies  a starting block number for a histogram bucket
421                     as h1.  Multiple -h's are given to specify  the  complete
422                     set of buckets.
423
424                 -m  specifies  that  the histogram starting block numbers are
425                     powers of m.  This is the general case of -b.
426
427                 -s  specifies that a final summary  of  total  free  extents,
428                     free blocks, and the average free extent size is printed.
429
430       fsb    See the fsblock command.
431
432       fsblock [fsb]
433              Set  current  address  to the fsblock value given by fsb.  If no
434              value for fsb is given the current address is printed, expressed
435              as  an  fsb.   The  type  is  set  to  data (uninterpreted). XFS
436              filesystem block numbers are computed ((agno << agshift)  |  ag‐
437              block) where agshift depends on the size of an allocation group.
438              Use the convert command to convert to and from this form.  Block
439              numbers  given  for file blocks (for instance from the bmap com‐
440              mand) are in this form.
441
442       fsmap [ start ] [ end ]
443              Prints the mapping of disk blocks used  by  an  XFS  filesystem.
444              The  map lists each extent used by files, allocation group meta‐
445              data, journalling logs, and static filesystem metadata, as  well
446              as  any  regions  that  are  unused.   All  blocks, offsets, and
447              lengths are specified in units of  512-byte  blocks,  no  matter
448              what the filesystem's block size is.  The optional start and end
449              arguments can be used to constrain the output  to  a  particular
450              range of disk blocks.
451
452       fuzz [-c] [-d] field action
453              Write  garbage  into a specific structure field on disk.  Expert
454              mode must be enabled to use this command.  The operation happens
455              immediately; there is no buffering.
456
457              The fuzz command can take the following actions against a field:
458
459                 zeroes
460                     Clears all bits in the field.
461
462                 ones
463                     Sets all bits in the field.
464
465                 firstbit
466                     Flips  the  first  bit in the field.  For a scalar value,
467                     this is the highest bit.
468
469                 middlebit
470                     Flips the middle bit in the field.
471
472                 lastbit
473                     Flips the last bit in the field.   For  a  scalar  value,
474                     this is the lowest bit.
475
476                 add Adds a small value to a scalar field.
477
478                 sub Subtracts a small value from a scalar field.
479
480                 random
481                     Randomizes the contents of the field.
482
483              The following switches affect the write behavior:
484
485                 -c  Skip  write  verifiers  and CRC recalculation; allows in‐
486                     valid data to be written to disk.
487
488                 -d  Skip write verifiers but perform CRC  recalculation;  al‐
489                     lows invalid data to be written to disk to test detection
490                     of invalid data.
491
492       hash string
493              Prints the hash value of string using the hash function  of  the
494              XFS directory and attribute implementation.
495
496       help [command]
497              Print help for one or all commands.
498
499       info   Displays  selected  geometry  information  about the filesystem.
500              The output will have the same  format  that  mkfs.xfs(8)  prints
501              when creating a filesystem or xfs_info(8) prints when querying a
502              filesystem.
503
504       inode [inode#]
505              Set the current inode number. If no inode# is given,  print  the
506              current inode number.
507
508       label [label]
509              Set  the  filesystem  label. The filesystem label can be used by
510              mount(8) instead of using a device special  file.   The  maximum
511              length  of an XFS label is 12 characters - use of a longer label
512              will result in truncation and a warning will be  issued.  If  no
513              label is given, the current filesystem label is printed.
514
515       log [stop | start filename]
516              Start  logging  output  to  filename, stop logging, or print the
517              current logging status.
518
519       logformat [-c cycle] [-s sunit]
520              Reformats the log to the specified  log  cycle  and  log  stripe
521              unit.   This  has  the effect of clearing the log destructively.
522              If the log cycle is not specified, the log is reformatted to the
523              current  cycle.   If  the  log stripe unit is not specified, the
524              stripe unit from the filesystem superblock is used.
525
526       logres Print transaction reservation size information for each transac‐
527              tion  type.   This  makes it easier to find discrepancies in the
528              reservation calculations between xfsprogs and the kernel,  which
529              will help when diagnosing minimum log size calculation errors.
530
531       ls [-i] [paths]...
532              List  the  contents of a directory.  If a path resolves to a di‐
533              rectory, the directory will be listed.  If no paths are supplied
534              and  the  IO cursor points at a directory inode, the contents of
535              that directory will be listed.
536
537              The output format is: directory cookie, inode number, file type,
538              hash, name length, name.
539
540                 -i  Resolve  each  of  the given paths to an inode number and
541                     print that number.  If no paths are given and the IO cur‐
542                     sor points to an inode, print the inode number.
543
544       metadump [-egow] filename
545              Dumps  metadata to a file. See xfs_metadump(8) for more informa‐
546              tion.
547
548       ncheck [-s] [-i ino] ...
549              Print name-inode pairs. A blockget -n command must be run  first
550              to gather the information.
551
552                 -i  specifies an inode number to be printed. If no -i options
553                     are given then all inodes are printed.
554
555                 -s  specifies that only setuid and setgid files are printed.
556
557       p      See the print command.
558
559       path dir_path
560              Walk the directory tree to an inode  using  the  supplied  path.
561              Absolute and relative paths are supported.
562
563       pop    Pop location from the stack.
564
565       print [field-expression] ...
566              Print  field  values.  If no argument is given, print all fields
567              in the current structure.
568
569       push [command]
570              Push location to the stack. If command is supplied, set the cur‐
571              rent  location  to  the results of command after pushing the old
572              location.
573
574       q      See the quit command.
575
576       quit   Exit xfs_db.
577
578       ring [index]
579              Show position ring (if no index argument is given), or move to a
580              specific entry in the position ring given by index.
581
582       sb [agno]
583              Set  current  address to SB header in allocation group agno.  If
584              no agno is given, use the current allocation group number.
585
586       source source-file
587              Process commands  from  source-file.   source  commands  can  be
588              nested.
589
590       stack  View the location stack.
591
592       type [type]
593              Set  the  current  data  type to type.  If no argument is given,
594              show the current data type.  The possible data types  are:  agf,
595              agfl,  agi,  attr,  bmapbta,  bmapbtd,  bnobt, cntbt, data, dir,
596              dir2, dqblk, inobt, inode, log, refcntbt, rmapbt, rtbitmap,  rt‐
597              summary,  sb, symlink and text.  See the TYPES section below for
598              more information on these data types.
599
600       timelimit [OPTIONS]
601              Print the minimum and maximum supported values for  inode  time‐
602              stamps,  quota  expiration  timers, and quota grace periods sup‐
603              ported by this filesystem.  Options include:
604
605                 --bigtime
606                     Print the time limits of an XFS filesystem with the  big‐
607                     time feature enabled.
608
609                 --classic
610                     Print the time limits of a classic XFS filesystem.
611
612                 --compact
613                     Print all limits as raw values on a single line.
614
615                 --pretty
616                     Print  the  timestamps  in  the current locale's date and
617                     time format instead of raw seconds since the Unix epoch.
618
619       uuid [uuid | generate | rewrite | restore]
620              Set the filesystem universally unique  identifier  (UUID).   The
621              filesystem  UUID  can be used by mount(8) instead of using a de‐
622              vice special file.  The uuid can be set directly to the  desired
623              UUID,  or  it  can be automatically generated using the generate
624              option. These options will both write the UUID into  every  copy
625              of  the superblock in the filesystem.  On a CRC-enabled filesys‐
626              tem, this will set an  incompatible  superblock  flag,  and  the
627              filesystem  will  not be mountable with older kernels.  This can
628              be reverted with the restore option, which will copy the  origi‐
629              nal  UUID  back  into  place  and clear the incompatible flag as
630              needed.  rewrite copies the current UUID from  the  primary  su‐
631              perblock to all secondary copies of the superblock.  If no argu‐
632              ment is given, the current filesystem UUID is printed.
633
634       version [feature | versionnum features2]
635              Enable selected features for a filesystem (certain features  can
636              be  enabled  on  an  unmounted filesystem, after mkfs.xfs(8) has
637              created the filesystem).  Support for unwritten extents  can  be
638              enabled  using the extflg option. Support for version 2 log for‐
639              mat can be enabled using the log2 option. Support  for  extended
640              attributes  can be enabled using the attr1 or attr2 option. Once
641              enabled, extended attributes cannot be disabled,  but  the  user
642              may  toggle  between  attr1 and attr2 at will (older kernels may
643              not support the newer version).
644
645              If no argument is given, the current version  and  feature  bits
646              are printed.  With one argument, this command will write the up‐
647              dated version number into every copy of the  superblock  in  the
648              filesystem.   If  two  arguments are given, they will be used as
649              numeric values for the versionnum  and  features2  bits  respec‐
650              tively,  and  their string equivalent reported (but no modifica‐
651              tions are made).
652
653       write [-c|-d] [field value] ...
654              Write a value to disk.  Specific fields can be set in structures
655              (struct mode), or a block can be set to data values (data mode),
656              or a block can be set to string values (string mode, for symlink
657              blocks).  The operation happens immediately: there is no buffer‐
658              ing.
659
660              Struct mode is in effect when the current  type  is  structural,
661              i.e.  not  data.  For  struct  mode,  the syntax is "write field
662              value".
663
664              Data mode is in effect when the current type is  data.  In  this
665              case the contents of the block can be shifted or rotated left or
666              right, or filled with a sequence, a constant value, or a  random
667              value.  In this mode write with no arguments gives more informa‐
668              tion on the allowed commands.
669
670                 -c  Skip write verifiers and CRC  recalculation;  allows  in‐
671                     valid data to be written to disk.
672
673                 -d  Skip write verifiers but perform CRC recalculation.  This
674                     allows invalid data to be written to disk to test  detec‐
675                     tion  of  invalid  data.   (This is not possible for some
676                     types.)
677

TYPES

679       This section gives the fields in each structure type  and  their  mean‐
680       ings.   Note that some types of block cover multiple actual structures,
681       for instance directory blocks.
682
683       agf       The AGF block is the header for block allocation information;
684                 it  is in the second 512-byte block of each allocation group.
685                 The following fields are defined:
686                     magicnum    AGF block magic number, 0x58414746 ('XAGF').
687                     versionnum  version number, currently 1.
688                     seqno       sequence number starting from 0.
689                     length      size in filesystem blocks of  the  allocation
690                                 group.  All allocation groups except the last
691                                 one of the filesystem have  the  superblock's
692                                 agblocks value here.
693                     bnoroot     block number of the root of the Btree holding
694                                 free space information sorted by  block  num‐
695                                 ber.
696                     cntroot     block number of the root of the Btree holding
697                                 free space information sorted by block count.
698                     bnolevel    number  of  levels  in  the   by-block-number
699                                 Btree.
700                     cntlevel    number of levels in the by-block-count Btree.
701                     flfirst     index into the AGFL block of the first active
702                                 entry.
703                     fllast      index into the AGFL block of the last  active
704                                 entry.
705                     flcount     count of active entries in the AGFL block.
706                     freeblks    count  of blocks represented in the freespace
707                                 Btrees.
708                     longest     longest  free  space   represented   in   the
709                                 freespace Btrees.
710                     btreeblks   number of blocks held in the AGF Btrees.
711
712       agfl      The  AGFL  block  contains block numbers for use of the block
713                 allocator; it is in the fourth 512-byte block of each alloca‐
714                 tion  group.  Each entry in the active list is a block number
715                 within the allocation group that can be used for any  purpose
716                 if space runs low.  The AGF block fields flfirst, fllast, and
717                 flcount designate which entries are currently active.   Entry
718                 space  is  allocated  in  a  circular  manner within the AGFL
719                 block.  Fields defined:
720                     bno         array of all block numbers. Even those  which
721                                 are not active are printed.
722
723       agi       The AGI block is the header for inode allocation information;
724                 it is in the third 512-byte block of each  allocation  group.
725                 Fields defined:
726                     magicnum    AGI block magic number, 0x58414749 ('XAGI').
727                     versionnum  version number, currently 1.
728                     seqno       sequence number starting from 0.
729                     length      size  in  filesystem blocks of the allocation
730                                 group.
731                     count       count of inodes allocated.
732                     root        block number of the root of the Btree holding
733                                 inode allocation information.
734                     level       number  of  levels  in  the  inode allocation
735                                 Btree.
736                     freecount   count of allocated inodes  that  are  not  in
737                                 use.
738                     newino      last inode number allocated.
739                     dirino      unused.
740                     unlinked    an  array of inode numbers within the alloca‐
741                                 tion group. The entries in the AGI block  are
742                                 the  heads of lists which run through the in‐
743                                 ode next_unlinked field. These inodes are  to
744                                 be  unlinked  the next time the filesystem is
745                                 mounted.
746
747       attr      An attribute fork is organized as a  Btree  with  the  actual
748                 data  embedded  in  the leaf blocks. The root of the Btree is
749                 found in block 0 of the fork.  The index (sort order) of  the
750                 Btree  is  the  hash  value  of  the attribute name.  All the
751                 blocks contain a blkinfo structure at the beginning, see type
752                 dir for a description. Nonleaf blocks are identical in format
753                 to those for version 1 and version 2  directories,  see  type
754                 dir  for  a  description. Leaf blocks can refer to "local" or
755                 "remote" attribute values. Local values are  stored  directly
756                 in the leaf block.  Leaf blocks contain the following fields:
757                     hdr         header  containing  a  blkinfo structure info
758                                 (magic number 0xfbee), a count of active  en‐
759                                 tries,  usedbytes  total  bytes  of names and
760                                 values, the firstused byte in the name  area,
761                                 holes  set if the block needs compaction, and
762                                 array freemap as for dir leaf blocks.
763                     entries     array of  structures  containing  a  hashval,
764                                 nameidx  (index  into the block of the name),
765                                 and flags incomplete, root, and local.
766                     nvlist      array of structures describing the  attribute
767                                 names and values. Fields always present: val‐
768                                 uelen (length of value  in  bytes),  namelen,
769                                 and  name.   Fields present for local values:
770                                 value (value string). Fields present for  re‐
771                                 mote  values:  valueblk (fork block number of
772                                 containing the value).
773
774                 Remote values are stored in an independent block in  the  at‐
775                 tribute  fork.   Prior  to v5, value blocks had no structure,
776                 but in v5 they acquired a header structure with the following
777                 fields:
778                     magic       attr3  remote  block magic number, 0x5841524d
779                                 ('XARM').
780                     offset      Byte offset of this  data  block  within  the
781                                 overall attribute value.
782                     bytes       Number of bytes stored in this block.
783                     crc         Checksum of the attribute block contents.
784                     uuid        Filesystem UUID.
785                     owner       Inode that owns this attribute value.
786                     bno         Block offset of this block within the inode's
787                                 attribute fork.
788                     lsn         Log serial number of the last time this block
789                                 was logged.
790                     data        The attribute value data.
791
792       bmapbt    Files  with many extents in their data or attribute fork will
793                 have the extents described by the contents  of  a  Btree  for
794                 that  fork,  instead  of  being stored directly in the inode.
795                 Each bmap Btree starts with a root block contained within the
796                 inode.   The other levels of the Btree are stored in filesys‐
797                 tem blocks.  The blocks are linked to sibling left and  right
798                 blocks  at  each level, as well as by pointers from parent to
799                 child blocks.  Each block contains the following fields:
800                     magic       bmap Btree  block  magic  number,  0x424d4150
801                                 ('BMAP').
802                     level       level of this block above the leaf level.
803                     numrecs     number of records or keys in the block.
804                     leftsib     left  (logically  lower)  sibling block, 0 if
805                                 none.
806                     rightsib    right (logically higher) sibling block, 0  if
807                                 none.
808                     recs        [leaf  blocks  only] array of extent records.
809                                 Each record  contains  startoff,  startblock,
810                                 blockcount,  and  extentflag (1 if the extent
811                                 is unwritten).
812                     keys        [non-leaf blocks only] array of key  records.
813                                 These  are  the first key value of each block
814                                 in the level below this one. Each record con‐
815                                 tains startoff.
816                     ptrs        [non-leaf  blocks  only] array of child block
817                                 pointers.  Each pointer is a filesystem block
818                                 number to the next level in the Btree.
819
820       bnobt     There  is  one set of filesystem blocks forming the by-block-
821                 number allocation Btree for each allocation group.  The  root
822                 block of this Btree is designated by the bnoroot field in the
823                 corresponding AGF block.  The blocks are  linked  to  sibling
824                 left  and  right blocks at each level, as well as by pointers
825                 from parent to child blocks.  Each block  has  the  following
826                 fields:
827                     magic       BNOBT    block   magic   number,   0x41425442
828                                 ('ABTB').
829                     level       level number of this block, 0 is a leaf.
830                     numrecs     number of data entries in the block.
831                     leftsib     left (logically lower) sibling  block,  0  if
832                                 none.
833                     rightsib    right  (logically higher) sibling block, 0 if
834                                 none.
835                     recs        [leaf  blocks  only]   array   of   freespace
836                                 records.  Each record contains startblock and
837                                 blockcount.
838                     keys        [non-leaf blocks only] array of key  records.
839                                 These  are  the  first value of each block in
840                                 the level below this one.  Each  record  con‐
841                                 tains startblock and blockcount.
842                     ptrs        [non-leaf  blocks  only] array of child block
843                                 pointers. Each  pointer  is  a  block  number
844                                 within the allocation group to the next level
845                                 in the Btree.
846
847       cntbt     There is one set of filesystem blocks forming  the  by-block-
848                 count  allocation  Btree  for each allocation group. The root
849                 block of this Btree is designated by the cntroot field in the
850                 corresponding  AGF  block.  The  blocks are linked to sibling
851                 left and right blocks at each level, as well as  by  pointers
852                 from  parent  to  child  blocks. Each block has the following
853                 fields:
854                     magic       CNTBT   block   magic   number,    0x41425443
855                                 ('ABTC').
856                     level       level number of this block, 0 is a leaf.
857                     numrecs     number of data entries in the block.
858                     leftsib     left  (logically  lower)  sibling block, 0 if
859                                 none.
860                     rightsib    right (logically higher) sibling block, 0  if
861                                 none.
862                     recs        [leaf   blocks   only]   array  of  freespace
863                                 records. Each record contains startblock  and
864                                 blockcount.
865                     keys        [non-leaf  blocks only] array of key records.
866                                 These are the first value of  each  block  in
867                                 the  level  below  this one. Each record con‐
868                                 tains blockcount and startblock.
869                     ptrs        [non-leaf blocks only] array of  child  block
870                                 pointers.  Each  pointer  is  a  block number
871                                 within the allocation group to the next level
872                                 in the Btree.
873
874       data      User  file  blocks,  and  other blocks whose type is unknown,
875                 have this type for display purposes  in  xfs_db.   The  block
876                 data is displayed in hexadecimal format.
877
878       dir       A version 1 directory is organized as a Btree with the direc‐
879                 tory data embedded in the leaf blocks. The root of the  Btree
880                 is  found  in  block 0 of the file. The index (sort order) of
881                 the Btree is the hash value of the entry name. All the blocks
882                 contain a blkinfo structure at the beginning with the follow‐
883                 ing fields:
884                     forw        next sibling block.
885                     back        previous sibling block.
886                     magic       magic number for this block type.
887                 The non-leaf (node) blocks have the following fields:
888                     hdr         header containing a  blkinfo  structure  info
889                                 (magic  number  0xfebe),  the count of active
890                                 entries, and the level of  this  block  above
891                                 the leaves.
892                     btree       array  of  entries containing hashval and be‐
893                                 fore fields. The before value is a block num‐
894                                 ber  within  the  directory file to the child
895                                 block, the hashval is the last hash value  in
896                                 that block.
897                 The leaf blocks have the following fields:
898                     hdr         header  containing  a  blkinfo structure info
899                                 (magic number 0xfeeb), the  count  of  active
900                                 entries, namebytes (total name string bytes),
901                                 holes  flag  (block  needs  compaction),  and
902                                 freemap (array of base, size entries for free
903                                 regions).
904                     entries     array  of  structures   containing   hashval,
905                                 nameidx  (byte  index  into  the block of the
906                                 name string), and namelen.
907                     namelist    array of structures  containing  inumber  and
908                                 name.
909
910       dir2      A  version 2 directory has four kinds of blocks.  Data blocks
911                 start at offset 0 in the file.  There are two kinds  of  data
912                 blocks:  single-block  directories  have the leaf information
913                 embedded at the end of the block, data blocks in  multi-block
914                 directories  do  not.   Node  and leaf blocks start at offset
915                 32GiB (with either a single  leaf  block  or  the  root  node
916                 block).   Freespace  blocks  start at offset 64GiB.  The node
917                 and leaf blocks form a Btree, with references to the data  in
918                 the data blocks.  The freespace blocks form an index of long‐
919                 est free spaces within the data blocks.
920
921                 A single-block directory block contains the following fields:
922                     bhdr        header  containing  magic  number  0x58443242
923                                 ('XD2B') and an array bestfree of the longest
924                                 3 free spaces in the block (offset, length).
925                     bu          array of union structures.  Each  element  is
926                                 either an entry or a freespace.  For entries,
927                                 there  are  the  following  fields:  inumber,
928                                 namelen, name, and tag.  For freespace, there
929                                 are the following fields:  freetag  (0xffff),
930                                 length,  and  tag.  The tag value is the byte
931                                 offset in the block of the start of the entry
932                                 it is contained in.
933                     bleaf       array  of leaf entries containing hashval and
934                                 address.  The address is a 64-bit word offset
935                                 into the file.
936                     btail       tail  structure containing the total count of
937                                 leaf entries and stale count of  unused  leaf
938                                 entries.
939                 A data block contains the following fields:
940                     dhdr        header  containing  magic  number  0x58443244
941                                 ('XD2D') and an array bestfree of the longest
942                                 3 free spaces in the block (offset, length).
943                     du          array of union structures as for bu.
944                 Leaf blocks have two possible forms. If the Btree consists of
945                 a single leaf then the freespace information is in  the  leaf
946                 block, otherwise it is in separate blocks and the root of the
947                 Btree is a node block. A leaf block  contains  the  following
948                 fields:
949                     lhdr        header  containing  a  blkinfo structure info
950                                 (magic number  0xd2f1  for  the  single  leaf
951                                 case,  0xd2ff  for  the true Btree case), the
952                                 total count of leaf entries, and stale  count
953                                 of unused leaf entries.
954                     lents       leaf entries, as for bleaf.
955                     lbests      [single leaf only] array of values which rep‐
956                                 resent the longest  freespace  in  each  data
957                                 block in the directory.
958                     ltail       [single  leaf only] tail structure containing
959                                 bestcount count of lbests.
960                 A node block is identical to that for types attr and dir.
961
962                 A freespace block contains the following fields:
963                     fhdr        header  containing  magic  number  0x58443246
964                                 ('XD2F'),  firstdb  first  data  block number
965                                 covered by this freespace block, nvalid  num‐
966                                 ber of valid entries, and nused number of en‐
967                                 tries representing real data blocks.
968                     fbests      array of values as for lbests.
969
970       dqblk     The quota information is stored in files referred to  by  the
971                 superblock  uquotino  and  pquotino  fields.  Each filesystem
972                 block in a quota file contains a constant number of quota en‐
973                 tries. The quota entry size is currently 136 bytes, so with a
974                 4KiB filesystem block size there are  30  quota  entries  per
975                 block.  The  dquot command is used to locate these entries in
976                 the filesystem.  The file entries are indexed by the user  or
977                 project  identifier  to determine the block and offset.  Each
978                 quota entry has the following fields:
979                     magic          magic number, 0x4451 ('DQ').
980                     version        version number, currently 1.
981                     flags          flags, values include 0x01 for user quota,
982                                    0x02 for project quota.
983                     id             user or project identifier.
984                     blk_hardlimit  absolute limit on blocks in use.
985                     blk_softlimit  preferred limit on blocks in use.
986                     ino_hardlimit  absolute limit on inodes in use.
987                     ino_softlimit  preferred limit on inodes in use.
988                     bcount         blocks actually in use.
989                     icount         inodes actually in use.
990                     itimer         time  when service will be refused if soft
991                                    limit is violated for inodes.
992                     btimer         time when service will be refused if  soft
993                                    limit is violated for blocks.
994                     iwarns         number  of  warnings  issued  about  inode
995                                    limit violations.
996                     bwarns         number  of  warnings  issued  about  block
997                                    limit violations.
998                     rtb_hardlimit  absolute limit on realtime blocks in use.
999                     rtb_softlimit  preferred limit on realtime blocks in use.
1000                     rtbcount       realtime blocks actually in use.
1001                     rtbtimer       time  when service will be refused if soft
1002                                    limit is violated for realtime blocks.
1003                     rtbwarns       number of warnings issued  about  realtime
1004                                    block limit violations.
1005
1006       inobt     There is one set of filesystem blocks forming the inode allo‐
1007                 cation Btree for each allocation group.  The  root  block  of
1008                 this Btree is designated by the root field in the correspond‐
1009                 ing AGI block.  The blocks are linked  to  sibling  left  and
1010                 right  blocks at each level, as well as by pointers from par‐
1011                 ent to child blocks.  Each block has the following fields:
1012                     magic       INOBT   block   magic   number,    0x49414254
1013                                 ('IABT').
1014                     level       level number of this block, 0 is a leaf.
1015                     numrecs     number of data entries in the block.
1016                     leftsib     left  (logically  lower)  sibling block, 0 if
1017                                 none.
1018                     rightsib    right (logically higher) sibling block, 0  if
1019                                 none.
1020                     recs        [leaf  blocks  only]  array of inode records.
1021                                 Each  record  contains  startino  allocation-
1022                                 group  relative inode number, freecount count
1023                                 of free inodes in this chunk, and  free  bit‐
1024                                 map, LSB corresponds to inode 0.
1025                     keys        [non-leaf  blocks only] array of key records.
1026                                 These are the first value of  each  block  in
1027                                 the  level  below  this one. Each record con‐
1028                                 tains startino.
1029                     ptrs        [non-leaf blocks only] array of  child  block
1030                                 pointers.  Each  pointer  is  a  block number
1031                                 within the allocation group to the next level
1032                                 in the Btree.
1033
1034       inode     Inodes are allocated in "chunks" of 64 inodes each. Usually a
1035                 chunk is multiple filesystem blocks, although there are cases
1036                 with  large  filesystem blocks where a chunk is less than one
1037                 block. The inode Btree (see inobt above) refers to the  inode
1038                 numbers  per allocation group. The inode numbers directly re‐
1039                 flect the location of the inode block on disk. Use the  inode
1040                 command  to point xfs_db to a specific inode. Each inode con‐
1041                 tains four regions: core, next_unlinked, u, and a.  core con‐
1042                 tains the fixed information.  next_unlinked is separated from
1043                 the core due to journaling considerations, see type agi field
1044                 unlinked.   u  is a union structure that is different in size
1045                 and format depending on the type and  representation  of  the
1046                 file data ("data fork").  a is an optional union structure to
1047                 describe attribute data, that is different in  size,  format,
1048                 and  location depending on the presence and representation of
1049                 attribute data, and  the  size  of  the  u  data  ("attribute
1050                 fork").   xfs_db  automatically selects the proper union mem‐
1051                 bers based on information in the inode.
1052
1053                 The following are fields in the inode core:
1054                     magic       inode magic number, 0x494e ('IN').
1055                     mode        mode  and  type  of  file,  as  described  in
1056                                 chmod(2), mknod(2), and stat(2).
1057                     version     inode version, 1 or 2.
1058                     format      format  of u union data (0: xfs_dev_t, 1: lo‐
1059                                 cal file - in-inode directory or symlink,  2:
1060                                 extent list, 3: Btree root, 4: unique id [un‐
1061                                 used]).
1062                     nlinkv1     number of links to the file in  a  version  1
1063                                 inode.
1064                     nlinkv2     number  of  links  to the file in a version 2
1065                                 inode.
1066                     projid_lo   owner's project id (low word; version 2 inode
1067                                 only).   projid_hi  owner's  project id (high
1068                                 word; version 2 inode only).
1069                     uid         owner's user id.
1070                     gid         owner's group id.
1071                     atime       time last accessed (seconds and nanoseconds).
1072                     mtime       time last modified.
1073                     ctime       time created or inode last modified.
1074                     size        number of bytes in the file.
1075                     nblocks     total number of blocks in the file  including
1076                                 indirect and attribute.
1077                     extsize     basic/minimum extent size for the file.
1078                     nextents    number of extents in the data fork.
1079                     naextents   number of extents in the attribute fork.
1080                     forkoff     attribute fork offset in the inode, in 64-bit
1081                                 words from the start of u.
1082                     aformat     format of a data (1: local attribute data, 2:
1083                                 extent list, 3: Btree root).
1084                     dmevmask    DMAPI event mask.
1085                     dmstate     DMAPI state information.
1086                     newrtbm     file is the realtime bitmap and is "new" for‐
1087                                 mat.
1088                     prealloc    file has preallocated data space after EOF.
1089                     realtime    file data is in the realtime subvolume.
1090                     gen         inode generation number.
1091                 The following fields are in the u data fork union:
1092                     bmbt        bmap Btree root. This looks  like  a  bmapbtd
1093                                 block with redundant information removed.
1094                     bmx         array of extent descriptors.
1095                     dev         dev_t for the block or character device.
1096                     sfdir       shortform  (in-inode)  version  1  directory.
1097                                 This consists of a hdr containing the  parent
1098                                 inode number and a count of active entries in
1099                                 the directory, followed by an array  list  of
1100                                 hdr.count  entries.  Each such entry contains
1101                                 inumber, namelen, and name string.
1102                     sfdir2      shortform  (in-inode)  version  2  directory.
1103                                 This  consists of a hdr containing a count of
1104                                 active entries in the directory,  an  i8count
1105                                 of  entries with inumbers that don't fit in a
1106                                 32-bit value, and the  parent  inode  number,
1107                                 followed  by  an  array list of hdr.count en‐
1108                                 tries. Each such entry  contains  namelen,  a
1109                                 saved  offset used when the directory is con‐
1110                                 verted to a larger form, a name  string,  and
1111                                 the inumber.
1112                     symlink     symbolic link string value.
1113                 The  following fields are in the a attribute fork union if it
1114                 exists:
1115                     bmbt        bmap Btree root, as above.
1116                     bmx         array of extent descriptors.
1117                     sfattr      shortform (in-inode) attribute  values.  This
1118                                 consists of a hdr containing a totsize (total
1119                                 size in bytes) and a count of active entries,
1120                                 followed  by  an  array list of hdr.count en‐
1121                                 tries. Each such entry contains namelen, val‐
1122                                 uelen, root flag, name, and value.
1123
1124       log       Log  blocks  contain  the  journal entries for XFS.  It's not
1125                 useful to examine these with xfs_db, use xfs_logprint(8)  in‐
1126                 stead.
1127
1128       refcntbt  There  is  one set of filesystem blocks forming the reference
1129                 count Btree for each allocation group. The root block of this
1130                 Btree  is  designated  by  the refcntroot field in the corre‐
1131                 sponding AGF block.  The blocks are linked  to  sibling  left
1132                 and  right  blocks at each level, as well as by pointers from
1133                 parent to child blocks.  Each block has the following fields:
1134                     magic       REFC block magic number, 0x52334643 ('R3FC').
1135                     level       level number of this block, 0 is a leaf.
1136                     numrecs     number of data entries in the block.
1137                     leftsib     left (logically lower) sibling  block,  0  if
1138                                 none.
1139                     rightsib    right  (logically higher) sibling block, 0 if
1140                                 none.
1141                     recs        [leaf blocks only] array of  reference  count
1142                                 records.  Each  record  contains  startblock,
1143                                 blockcount, and refcount.
1144                     keys        [non-leaf blocks only] array of key  records.
1145                                 These  are  the  first value of each block in
1146                                 the level below this one.  Each  record  con‐
1147                                 tains startblock.
1148                     ptrs        [non-leaf  blocks  only] array of child block
1149                                 pointers. Each  pointer  is  a  block  number
1150                                 within the allocation group to the next level
1151                                 in the Btree.
1152
1153       rmapbt    There is one set of filesystem  blocks  forming  the  reverse
1154                 mapping  Btree  for  each allocation group. The root block of
1155                 this Btree is designated by the rmaproot field in the  corre‐
1156                 sponding  AGF  block.   The blocks are linked to sibling left
1157                 and right blocks at each level, as well as by  pointers  from
1158                 parent to child blocks.  Each block has the following fields:
1159                     magic       RMAP block magic number, 0x524d4233 ('RMB3').
1160                     level       level number of this block, 0 is a leaf.
1161                     numrecs     number of data entries in the block.
1162                     leftsib     left  (logically  lower)  sibling block, 0 if
1163                                 none.
1164                     rightsib    right (logically higher) sibling block, 0  if
1165                                 none.
1166                     recs        [leaf  blocks  only] array of reference count
1167                                 records.  Each  record  contains  startblock,
1168                                 blockcount,    owner,    offset,   attr_fork,
1169                                 bmbt_block, and unwritten.
1170                     keys        [non-leaf blocks only]  array  of  double-key
1171                                 records.  The  first ("low") key contains the
1172                                 first value of each block in the level  below
1173                                 this  one.  The  second ("high") key contains
1174                                 the largest key that can be used to  identify
1175                                 any  record  in the subtree. Each record con‐
1176                                 tains startblock, owner,  offset,  attr_fork,
1177                                 and bmbt_block.
1178                     ptrs        [non-leaf  blocks  only] array of child block
1179                                 pointers. Each  pointer  is  a  block  number
1180                                 within the allocation group to the next level
1181                                 in the Btree.
1182
1183       rtbitmap  If the filesystem has a realtime subvolume, then  the  rbmino
1184                 field  in  the  superblock refers to a file that contains the
1185                 realtime bitmap.  Each bit in the bitmap  file  controls  the
1186                 allocation  of  a  single  realtime extent (set == free). The
1187                 bitmap is processed in 32-bit words, the LSB  of  a  word  is
1188                 used for the first extent controlled by that bitmap word. The
1189                 atime field of the realtime bitmap inode contains  a  counter
1190                 that is used to control where the next new realtime file will
1191                 start.
1192
1193       rtsummary If the filesystem has a realtime subvolume, then the  rsumino
1194                 field  in  the  superblock refers to a file that contains the
1195                 realtime summary data. The summary file contains a two-dimen‐
1196                 sional  array of 16-bit values.  Each value counts the number
1197                 of free extent runs (consecutive free realtime extents) of  a
1198                 given  range  of  sizes  that starts in a given bitmap block.
1199                 The size ranges are binary buckets (low size in the bucket is
1200                 a  power  of 2).  There are as many size ranges as are neces‐
1201                 sary given the size of the realtime subvolume.  The first di‐
1202                 mension is the size range, the second dimension is the start‐
1203                 ing bitmap block number (adjacent entries are  for  the  same
1204                 size, adjacent bitmap blocks).
1205
1206       sb        There  is one sb (superblock) structure per allocation group.
1207                 It is the first disk block in the allocation group.  Only the
1208                 first  one  (block 0 of the filesystem) is actually used; the
1209                 other blocks are redundant information for  xfs_repair(8)  to
1210                 use if the first superblock is damaged. Fields defined:
1211                     magicnum    superblock magic number, 0x58465342 ('XFSB').
1212                     blocksize   filesystem block size in bytes.
1213                     dblocks     number  of  filesystem  blocks present in the
1214                                 data subvolume.
1215                     rblocks     number of filesystem blocks  present  in  the
1216                                 realtime subvolume.
1217                     rextents    number  of realtime extents that rblocks con‐
1218                                 tain.
1219                     uuid        unique identifier of the filesystem.
1220                     logstart    starting filesystem block number of  the  log
1221                                 (journal).   If  this  value  is 0 the log is
1222                                 "external".
1223                     rootino     root inode number.
1224                     rbmino      realtime bitmap inode number.
1225                     rsumino     realtime summary data inode number.
1226                     rextsize    realtime extent size in filesystem blocks.
1227                     agblocks    size of an  allocation  group  in  filesystem
1228                                 blocks.
1229                     agcount     number of allocation groups.
1230                     rbmblocks   number of realtime bitmap blocks.
1231                     logblocks   number of log blocks (filesystem blocks).
1232                     versionnum  filesystem  version  information.  This value
1233                                 is currently 1, 2, 3, or 4 in the low 4 bits.
1234                                 If  the  low  bits  are 4 then the other bits
1235                                 have additional meanings.  1 is the  original
1236                                 value.  2 means that attributes were used.  3
1237                                 means  that  version  2  inodes  (large  link
1238                                 counts)  were used.  4 is the bitmask version
1239                                 of the version number.   In  this  case,  the
1240                                 other  bits  are  used  as flags (0x0010: at‐
1241                                 tributes were used, 0x0020: version 2  inodes
1242                                 were  used, 0x0040: quotas were used, 0x0080:
1243                                 inode cluster alignment is in force,  0x0100:
1244                                 data  stripe  alignment  is in force, 0x0200:
1245                                 the shared_vn field is used, 0x1000:  unwrit‐
1246                                 ten  extent tracking is on, 0x2000: version 2
1247                                 directories are in use).
1248                     sectsize    sector size in bytes, currently  always  512.
1249                                 This  is  the  size of the superblock and the
1250                                 other header blocks.
1251                     inodesize   inode size in bytes.
1252                     inopblock   number of inodes per filesystem block.
1253                     fname       obsolete, filesystem name.
1254                     fpack       obsolete, filesystem pack name.
1255                     blocklog    log2 of blocksize.
1256                     sectlog     log2 of sectsize.
1257                     inodelog    log2 of inodesize.
1258                     inopblog    log2 of inopblock.
1259                     agblklog    log2 of agblocks (rounded up).
1260                     rextslog    log2 of rextents.
1261                     inprogress  mkfs.xfs(8)  or  xfs_copy(8)  aborted  before
1262                                 completing this filesystem.
1263                     imax_pct    maximum  percentage  of filesystem space used
1264                                 for inode blocks.
1265                     icount      number of allocated inodes.
1266                     ifree       number of allocated inodes that  are  not  in
1267                                 use.
1268                     fdblocks    number of free data blocks.
1269                     frextents   number of free realtime extents.
1270                     uquotino    user quota inode number.
1271                     pquotino    project quota inode number; this is currently
1272                                 unused.
1273                     qflags      quota status flags (0x01: user quota account‐
1274                                 ing  is  on,  0x02: user quota limits are en‐
1275                                 forced, 0x04: quotacheck has been run on user
1276                                 quotas, 0x08: project quota accounting is on,
1277                                 0x10:  project  quota  limits  are  enforced,
1278                                 0x20: quotacheck has been run on project quo‐
1279                                 tas).
1280                     flags       random flags. 0x01: only read-only mounts are
1281                                 allowed.
1282                     shared_vn   shared   version   number   (shared  readonly
1283                                 filesystems).
1284                     inoalignmt  inode chunk alignment in filesystem blocks.
1285                     unit        stripe or RAID unit.
1286                     width       stripe or RAID width.
1287                     dirblklog   log2  of  directory  block  size  (filesystem
1288                                 blocks).
1289
1290       symlink   Symbolic  link  blocks  are  used only when the symbolic link
1291                 value does not fit inside the inode.  The  block  content  is
1292                 just  the  string  value.   Bytes past the logical end of the
1293                 symbolic link value have arbitrary values.
1294
1295       text      User file blocks, and other blocks  whose  type  is  unknown,
1296                 have  this  type  for  display purposes in xfs_db.  The block
1297                 data is displayed in  two  columns:  Hexadecimal  format  and
1298                 printable ASCII chars.
1299

DIAGNOSTICS

1301       Many  messages  can  come  from  the  check (blockget) command.  If the
1302       filesystem is completely corrupt, a core dump might be produced instead
1303       of the message
1304              device is not a valid filesystem
1305
1306       If  the  filesystem is very large (has many files) then check might run
1307       out of memory. In this case the message
1308              out of memory
1309       is printed.
1310
1311       The following is a description of the most likely problems and the  as‐
1312       sociated  messages.  Most of the diagnostics produced are only meaning‐
1313       ful with an understanding of the structure of the filesystem.
1314
1315       agf_freeblks n, counted m in ag a
1316              The freeblocks count in the allocation group header for  alloca‐
1317              tion group a doesn't match the number of blocks counted free.
1318
1319       agf_longest n, counted m in ag a
1320              The longest free extent in the allocation group header for allo‐
1321              cation group a doesn't match the longest free  extent  found  in
1322              the allocation group.
1323
1324       agi_count n, counted m in ag a
1325              The allocated inode count in the allocation group header for al‐
1326              location group a doesn't match the number of inodes  counted  in
1327              the allocation group.
1328
1329       agi_freecount n, counted m in ag a
1330              The  free inode count in the allocation group header for alloca‐
1331              tion group a doesn't match the number of inodes counted free  in
1332              the allocation group.
1333
1334       block a/b expected inum 0 got i
1335              The  block  number is specified as a pair (allocation group num‐
1336              ber, block in the allocation group).  The block is used multiple
1337              times  (shared),  between multiple inodes.  This message usually
1338              follows a message of the next type.
1339
1340       block a/b expected type unknown got y
1341              The block is used multiple times (shared).
1342
1343       block a/b type unknown not expected
1344

SEE ALSO

1346       mkfs.xfs(8),  xfs_admin(8),  xfs_copy(8),  xfs_logprint(8),  xfs_metad‐
1347       ump(8),  xfs_ncheck(8),  xfs_repair(8),  mount(8),  chmod(2), mknod(2),
1348       stat(2), xfs(5).
1349
1350
1351
1352                                                                     xfs_db(8)
Impressum