]>
Commit | Line | Data |
---|---|---|
2bd0ea18 NS |
1 | .TH xfs_db 8 |
2 | .SH NAME | |
3 | xfs_db \- debug an XFS filesystem | |
4 | .SH SYNOPSIS | |
2017d0d0 BN |
5 | .B xfs_db |
6 | [ | |
7 | .B \-c | |
8 | .I cmd | |
9 | ] ... [ | |
7f98455a | 10 | .BR \-i | r | x | F |
2017d0d0 BN |
11 | ] [ |
12 | .B \-f | |
13 | ] [ | |
14 | .B \-l | |
15 | .I logdev | |
16 | ] [ | |
17 | .B \-p | |
18 | .I progname | |
19 | ] | |
20 | .I device | |
21 | .br | |
22 | .B xfs_db \-V | |
2bd0ea18 | 23 | .SH DESCRIPTION |
2017d0d0 BN |
24 | .B xfs_db |
25 | is used to examine an XFS filesystem. Under rare circumstances it can also | |
26 | be used to modify an XFS filesystem, but that task is normally left to | |
27 | .BR xfs_repair (8) | |
28 | or to scripts such as | |
29 | .BR xfs_admin (8) | |
30 | that run | |
31 | .BR xfs_db . | |
2bd0ea18 | 32 | .PP |
2017d0d0 BN |
33 | .SH OPTIONS |
34 | .TP | |
35 | .BI \-c " cmd" | |
36 | .B xfs_db | |
37 | commands may be run interactively (the default) or as arguments | |
38 | on the command line. Multiple | |
39 | .B \-c | |
40 | arguments may be given. The commands are run in the sequence given, | |
bfc541e7 | 41 | then the program exits. |
2017d0d0 BN |
42 | .TP |
43 | .B \-f | |
d2df702b | 44 | Specifies that the filesystem image to be processed is stored in a |
2017d0d0 BN |
45 | regular file at |
46 | .I device | |
47 | (see the | |
48 | .BR mkfs.xfs "(8) " -d | |
49 | .I file | |
50 | option). | |
51 | This might happen if an image copy of a filesystem has been made into | |
52 | an ordinary file with | |
53 | .BR xfs_copy (8). | |
54 | .TP | |
7f98455a CH |
55 | .B \-F |
56 | Specifies that we want to continue even if the superblock magic is not | |
57 | correct. For use in | |
7f98455a CH |
58 | .BR xfs_metadump . |
59 | .TP | |
2017d0d0 BN |
60 | .B \-i |
61 | Allows execution on a mounted filesystem, provided it is mounted read-only. | |
bfc541e7 | 62 | Useful for shell scripts |
87342c3a | 63 | which must only operate on filesystems in a guaranteed consistent state |
2017d0d0 BN |
64 | (either unmounted or mounted read-only). These semantics are slightly |
65 | different to that of the | |
66 | .B -r | |
67 | option. | |
2bd0ea18 | 68 | .TP |
2017d0d0 BN |
69 | .BI \-l " logdev" |
70 | Specifies the device where the filesystems external log resides. | |
71 | Only for those filesystems which use an external log. See the | |
72 | .BR mkfs.xfs "(8) " \-l | |
73 | option, and refer to | |
74 | .BR xfs (5) | |
cc01ba7a NS |
75 | for a detailed description of the XFS log. |
76 | .TP | |
2017d0d0 BN |
77 | .BI \-p " progname" |
78 | Set the program name to | |
79 | .I progname | |
80 | for prompts and some error messages, the default value is | |
81 | .BR xfs_db . | |
82 | .TP | |
83 | .B -r | |
84 | Open | |
85 | .I device | |
86 | or | |
87 | .I filename | |
88 | read-only. This option is required if the filesystem is mounted. | |
2bd0ea18 | 89 | It is only necessary to omit this flag if a command that changes data |
b64af2c4 | 90 | .RB ( write ", " blocktrash ", " crc ) |
2017d0d0 | 91 | is to be used. |
2bd0ea18 | 92 | .TP |
2017d0d0 | 93 | .B \-x |
2bd0ea18 | 94 | Specifies expert mode. |
2017d0d0 | 95 | This enables the |
b64af2c4 ES |
96 | .RB ( write ", " blocktrash ", " crc |
97 | invalidate/revalidate) commands. | |
2017d0d0 BN |
98 | .TP |
99 | .B \-V | |
eaa6a2bf | 100 | Prints the version number and exits. |
2bd0ea18 | 101 | .SH CONCEPTS |
2017d0d0 BN |
102 | .B xfs_db |
103 | commands can be broken up into two classes. Most commands are for | |
104 | the navigation and display of data structures in the filesystem. | |
2bd0ea18 NS |
105 | Other commands are for scanning the filesystem in some way. |
106 | .PP | |
107 | Commands which are used to navigate the filesystem structure take arguments | |
108 | which reflect the names of filesystem structure fields. | |
109 | There can be multiple field names separated by dots when the underlying | |
110 | structures are nested, as in C. | |
111 | The field names can be indexed (as an array index) | |
112 | if the underlying field is an array. | |
113 | The array indices can be specified as a range, two numbers separated by a dash. | |
114 | .PP | |
2017d0d0 BN |
115 | .B xfs_db |
116 | maintains a current address in the filesystem. | |
2bd0ea18 NS |
117 | The granularity of the address is a filesystem structure. |
118 | This can be a filesystem block, | |
119 | an inode or quota (smaller than a filesystem block), | |
120 | or a directory block (could be larger than a filesystem block). | |
121 | There are a variety of commands to set the current address. | |
122 | Associated with the current address is the current data type, | |
123 | which is the structural type of this data. | |
124 | Commands which follow the structure of the filesystem always set the type | |
125 | as well as the address. | |
126 | Commands which examine pieces of an individual file (inode) need the current | |
2017d0d0 BN |
127 | inode to be set, this is done with the |
128 | .B inode | |
129 | command. | |
2bd0ea18 NS |
130 | .PP |
131 | The current address/type information is actually maintained in a | |
132 | stack that can be explicitly manipulated with the | |
2017d0d0 BN |
133 | .BR push ", " pop ", and " stack |
134 | commands. | |
2bd0ea18 NS |
135 | This allows for easy examination of a nested filesystem structure. |
136 | Also, the last several locations visited are stored in a ring buffer | |
137 | which can be manipulated with the | |
2017d0d0 BN |
138 | .BR forward ", " back ", and " ring |
139 | commands. | |
2bd0ea18 NS |
140 | .PP |
141 | XFS filesystems are divided into a small number of allocation groups. | |
2017d0d0 BN |
142 | .B xfs_db |
143 | maintains a notion of the current allocation group which is | |
144 | manipulated by some commands. The initial allocation group is 0. | |
2bd0ea18 NS |
145 | .SH COMMANDS |
146 | .PP | |
2017d0d0 BN |
147 | Many commands have extensive online help. Use the |
148 | .B help | |
149 | command for more details on any command. | |
150 | .TP | |
151 | .B a | |
152 | See the | |
153 | .B addr | |
154 | command. | |
155 | .TP | |
156 | .BI ablock " filoff" | |
967d4e13 BN |
157 | Set current address to the offset |
158 | .I filoff | |
2017d0d0 BN |
159 | (a filesystem block number) in the attribute area of the current inode. |
160 | .TP | |
161 | .BI "addr [" field-expression ] | |
162 | Set current address to the value of the | |
163 | .IR field-expression . | |
164 | This is used to "follow" a reference in one structure to the object | |
967d4e13 | 165 | being referred to. If no argument is given, the current address is printed. |
2017d0d0 BN |
166 | .TP |
167 | .BI "agf [" agno ] | |
168 | Set current address to the AGF block for allocation group | |
169 | .IR agno . | |
967d4e13 | 170 | If no argument is given, use the current allocation group. |
2bd0ea18 | 171 | .TP |
2017d0d0 BN |
172 | .BI "agfl [" agno ] |
173 | Set current address to the AGFL block for allocation group | |
174 | .IR agno . | |
967d4e13 | 175 | If no argument is given, use the current allocation group. |
2bd0ea18 | 176 | .TP |
2017d0d0 BN |
177 | .BI "agi [" agno ] |
178 | Set current address to the AGI block for allocation group | |
179 | .IR agno . | |
967d4e13 | 180 | If no argument is given, use the current allocation group. |
2bd0ea18 | 181 | .TP |
2017d0d0 BN |
182 | .B b |
183 | See the | |
184 | .B back | |
185 | command. | |
2bd0ea18 | 186 | .TP |
2017d0d0 | 187 | .B back |
2bd0ea18 NS |
188 | Move to the previous location in the position ring. |
189 | .TP | |
2017d0d0 | 190 | .B blockfree |
2bd0ea18 | 191 | Free block usage information collected by the last execution of the |
2017d0d0 BN |
192 | .B blockget |
193 | command. This must be done before another | |
194 | .B blockget | |
195 | command can be given, presumably with different arguments than the previous one. | |
2bd0ea18 | 196 | .TP |
2017d0d0 | 197 | .BI "blockget [\-npvs] [\-b " bno "] ... [\-i " ino "] ..." |
2bd0ea18 NS |
198 | Get block usage and check filesystem consistency. |
199 | The information is saved for use by a subsequent | |
2017d0d0 | 200 | .BR blockuse ", " ncheck ", or " blocktrash |
bfc541e7 | 201 | command. |
2017d0d0 BN |
202 | .RS 1.0i |
203 | .TP 0.4i | |
204 | .B \-b | |
205 | is used to specify filesystem block numbers about which verbose | |
206 | information should be printed. | |
207 | .TP | |
208 | .B \-i | |
209 | is used to specify inode numbers about which verbose information | |
210 | should be printed. | |
211 | .TP | |
212 | .B \-n | |
213 | is used to save pathnames for inodes visited, this is used to support the | |
214 | .BR xfs_ncheck (8) | |
215 | command. It also means that pathnames will be printed for inodes that have | |
216 | problems. This option uses a lot of memory so is not enabled by default. | |
217 | .TP | |
218 | .B \-p | |
219 | causes error messages to be prefixed with the filesystem name being | |
220 | processed. This is useful if several copies of | |
221 | .B xfs_db | |
222 | are run in parallel. | |
223 | .TP | |
224 | .B \-s | |
225 | restricts output to severe errors only. This is useful if the output is | |
226 | too long otherwise. | |
227 | .TP | |
228 | .B \-v | |
229 | enables verbose output. Messages will be printed for every block and | |
230 | inode processed. | |
231 | .RE | |
232 | .TP | |
37faa0da | 233 | .BI "blocktrash [-z] [\-o " offset "] [\-n " count "] [\-x " min "] [\-y " max "] [\-s " seed "] [\-0|1|2|3] [\-t " type "] ..." |
2bd0ea18 NS |
234 | Trash randomly selected filesystem metadata blocks. |
235 | Trashing occurs to randomly selected bits in the chosen blocks. | |
2017d0d0 BN |
236 | This command is available only in debugging versions of |
237 | .BR xfs_db . | |
238 | It is useful for testing | |
bfc541e7 | 239 | .BR xfs_repair "(8). |
2017d0d0 BN |
240 | .RS 1.0i |
241 | .TP 0.4i | |
242 | .BR \-0 " | " -1 " | " -2 " | " -3 | |
243 | These are used to set the operating mode for | |
244 | .BR blocktrash . | |
245 | Only one can be used: | |
246 | .B \-0 | |
247 | changed bits are cleared; | |
248 | .B \-1 | |
249 | changed bits are set; | |
250 | .B -2 | |
251 | changed bits are inverted; | |
252 | .B -3 | |
253 | changed bits are randomized. | |
254 | .TP | |
255 | .B \-n | |
256 | supplies the | |
257 | .I count | |
258 | of block-trashings to perform (default 1). | |
259 | .TP | |
37faa0da DW |
260 | .B \-o |
261 | supplies the bit | |
262 | .I offset | |
263 | at which to start trashing the block. If the value is preceded by a '+', the | |
264 | trashing will start at a randomly chosen offset that is larger than the value | |
265 | supplied. The default is to randomly choose an offset anywhere in the block. | |
266 | .TP | |
2017d0d0 BN |
267 | .B \-s |
268 | supplies a | |
269 | .I seed | |
270 | to the random processing. | |
271 | .TP | |
272 | .B \-t | |
273 | gives a | |
274 | .I type | |
275 | of blocks to be selected for trashing. Multiple | |
276 | .B \-t | |
277 | options may be given. If no | |
278 | .B \-t | |
279 | options are given then all metadata types can be trashed. | |
280 | .TP | |
281 | .B \-x | |
282 | sets the | |
283 | .I minimum | |
284 | size of bit range to be trashed. The default value is 1. | |
285 | .TP | |
286 | .B \-y | |
287 | sets the | |
288 | .I maximum | |
289 | size of bit range to be trashed. The default value is 1024. | |
37faa0da DW |
290 | .TP |
291 | .B \-z | |
292 | trashes the block at the top of the stack. It is not necessary to | |
293 | run | |
294 | .BI blockget | |
295 | if this option is supplied. | |
2017d0d0 BN |
296 | .RE |
297 | .TP | |
298 | .BI "blockuse [\-n] [\-c " count ] | |
2bd0ea18 NS |
299 | Print usage for current filesystem block(s). |
300 | For each block, the type and (if any) inode are printed. | |
2017d0d0 BN |
301 | .RS 1.0i |
302 | .TP 0.4i | |
303 | .B \-c | |
304 | specifies a | |
305 | .I count | |
306 | of blocks to process. The default value is 1 (the current block only). | |
307 | .TP | |
308 | .B \-n | |
309 | specifies that file names should be printed. The prior | |
310 | .B blockget | |
311 | command must have also specified the | |
312 | .B \-n | |
313 | option. | |
314 | .RE | |
2bd0ea18 | 315 | .TP |
2e53a4f5 | 316 | .BI "bmap [\-a] [\-d] [" block " [" len ]] |
2bd0ea18 NS |
317 | Show the block map for the current inode. |
318 | The map display can be restricted to an area of the file with the | |
2017d0d0 BN |
319 | .I block |
320 | and | |
321 | .I len | |
322 | arguments. If | |
323 | .I block | |
324 | is given and | |
325 | .I len | |
326 | is omitted then 1 is assumed for len. | |
327 | .IP | |
328 | The | |
329 | .B \-a | |
330 | and | |
331 | .B \-d | |
332 | options are used to select the attribute or data | |
2bd0ea18 NS |
333 | area of the inode, if neither option is given then both areas are shown. |
334 | .TP | |
21f0bffe DW |
335 | .B btdump [-a] [-i] |
336 | If the cursor points to a btree node, dump the btree from that block downward. | |
337 | If instead the cursor points to an inode, dump the data fork block mapping btree if there is one. | |
a05feedb | 338 | If the cursor points to a directory or extended attribute btree node, dump that. |
21f0bffe DW |
339 | By default, only records stored in the btree are dumped. |
340 | .RS 1.0i | |
341 | .TP 0.4i | |
342 | .B \-a | |
343 | If the cursor points at an inode, dump the extended attribute block mapping btree, if present. | |
344 | .TP | |
345 | .B \-i | |
346 | Dump all keys and pointers in intermediate btree nodes, and all records in leaf btree nodes. | |
347 | .RE | |
348 | .TP | |
2017d0d0 BN |
349 | .B check |
350 | See the | |
351 | .B blockget | |
352 | command. | |
2bd0ea18 | 353 | .TP |
2017d0d0 | 354 | .BI "convert " "type number" " [" "type number" "] ... " type |
2bd0ea18 | 355 | Convert from one address form to another. |
2017d0d0 BN |
356 | The known |
357 | .IR type s, | |
358 | with alternate names, are: | |
359 | .RS 1.0i | |
360 | .PD 0 | |
361 | .HP | |
362 | .B agblock | |
363 | or | |
364 | .B agbno | |
365 | (filesystem block within an allocation group) | |
366 | .HP | |
367 | .B agino | |
368 | or | |
369 | .B aginode | |
370 | (inode number within an allocation group) | |
371 | .HP | |
372 | .B agnumber | |
373 | or | |
374 | .B agno | |
375 | (allocation group number) | |
376 | .HP | |
377 | .B bboff | |
378 | or | |
379 | .B daddroff | |
380 | (byte offset in a | |
381 | .BR daddr ) | |
382 | .HP | |
383 | .B blkoff | |
384 | or | |
385 | .B fsboff or | |
386 | .B agboff | |
387 | (byte offset in a | |
388 | .B agblock | |
389 | or | |
390 | .BR fsblock ) | |
391 | .HP | |
392 | .B byte | |
393 | or | |
394 | .B fsbyte | |
395 | (byte address in filesystem) | |
396 | .HP | |
397 | .B daddr | |
398 | or | |
399 | .B bb | |
400 | (disk address, 512-byte blocks) | |
401 | .HP | |
402 | .B fsblock | |
403 | or | |
404 | .B fsb | |
405 | or | |
406 | .B fsbno | |
407 | (filesystem block, see the | |
408 | .B fsblock | |
409 | command) | |
410 | .HP | |
411 | .B ino | |
412 | or | |
413 | .B inode | |
414 | (inode number) | |
415 | .HP | |
416 | .B inoidx | |
417 | or | |
418 | .B offset | |
419 | (index of inode in filesystem block) | |
420 | .HP | |
421 | .B inooff | |
422 | or | |
423 | .B inodeoff | |
424 | (byte offset in inode) | |
425 | .PD | |
426 | .RE | |
427 | .IP | |
428 | Only conversions that "make sense" are allowed. | |
2bd0ea18 NS |
429 | The compound form (with more than three arguments) is useful for |
430 | conversions such as | |
2017d0d0 BN |
431 | .B convert agno |
432 | .I ag | |
433 | .B agbno | |
434 | .I agb | |
435 | .BR fsblock . | |
436 | .TP | |
b64af2c4 ES |
437 | .B crc [\-i|\-r|\-v] |
438 | Invalidates, revalidates, or validates the CRC (checksum) | |
439 | field of the current structure, if it has one. | |
440 | This command is available only on CRC-enabled filesystems. | |
441 | With no argument, validation is performed. | |
442 | Each command will display the resulting CRC value and state. | |
443 | .RS 1.0i | |
444 | .TP 0.4i | |
445 | .B \-i | |
446 | Invalidate the structure's CRC value (incrementing it by one), | |
447 | and write it to disk. | |
448 | .TP | |
449 | .B \-r | |
450 | Recalculate the current structure's correct CRC value, and write it to disk. | |
451 | .TP | |
452 | .B \-v | |
453 | Validate and display the current value and state of the structure's CRC. | |
454 | .RE | |
455 | .TP | |
2017d0d0 BN |
456 | .BI "daddr [" d ] |
457 | Set current address to the daddr (512 byte block) given by | |
458 | .IR d . | |
459 | If no value for | |
460 | .I d | |
967d4e13 BN |
461 | is given, the current address is printed, expressed as a daddr. |
462 | The type is set to | |
2017d0d0 BN |
463 | .B data |
464 | (uninterpreted). | |
465 | .TP | |
466 | .BI dblock " filoff" | |
467 | Set current address to the offset | |
468 | .I filoff | |
469 | (a filesystem block number) in the data area of the current inode. | |
470 | .TP | |
471 | .BI "debug [" flagbits ] | |
472 | Set debug option bits. These are used for debugging | |
473 | .BR xfs_db . | |
474 | If no value is given for | |
475 | .IR flagbits , | |
476 | print the current debug option bits. These are for the use of the implementor. | |
477 | .TP | |
fa247a5b ES |
478 | .BI "dquot [" \-g | \-p | \-u ] " id" |
479 | Set current address to a group, project or user quota block for the given ID. Defaults to user quota. | |
2bd0ea18 | 480 | .TP |
2017d0d0 | 481 | .BI "echo [" arg "] ..." |
2bd0ea18 NS |
482 | Echo the arguments to the output. |
483 | .TP | |
2017d0d0 BN |
484 | .B f |
485 | See the | |
486 | .B forward | |
487 | command. | |
2bd0ea18 | 488 | .TP |
2017d0d0 | 489 | .B forward |
2bd0ea18 NS |
490 | Move forward to the next entry in the position ring. |
491 | .TP | |
2017d0d0 BN |
492 | .B frag [\-adflqRrv] |
493 | Get file fragmentation data. This prints information about fragmentation | |
494 | of file data in the filesystem (as opposed to fragmentation of freespace, | |
495 | for which see the | |
496 | .B freesp | |
497 | command). Every file in the filesystem is examined to see how far from ideal | |
498 | its extent mappings are. A summary is printed giving the totals. | |
499 | .RS 1.0i | |
500 | .TP 0.4i | |
501 | .B \-v | |
502 | sets verbosity, every inode has information printed for it. | |
2bd0ea18 NS |
503 | The remaining options select which inodes and extents are examined. |
504 | If no options are given then all are assumed set, | |
505 | otherwise just those given are enabled. | |
2bd0ea18 | 506 | .TP |
2017d0d0 BN |
507 | .B \-a |
508 | enables processing of attribute data. | |
509 | .TP | |
510 | .B \-d | |
511 | enables processing of directory data. | |
512 | .TP | |
513 | .B \-f | |
514 | enables processing of regular file data. | |
515 | .TP | |
516 | .B \-l | |
517 | enables processing of symbolic link data. | |
518 | .TP | |
519 | .B \-q | |
520 | enables processing of quota file data. | |
521 | .TP | |
522 | .B \-R | |
523 | enables processing of realtime control file data. | |
524 | .TP | |
525 | .B \-r | |
526 | enables processing of realtime file data. | |
527 | .RE | |
528 | .TP | |
732f8f5a | 529 | .BI "freesp [\-bcds] [\-A " alignment "] [\-a " ag "] ... [\-e " i "] [\-h " h1 "] ... [\-m " m ] |
2017d0d0 BN |
530 | Summarize free space for the filesystem. The free blocks are examined |
531 | and totalled, and displayed in the form of a histogram, with a count | |
532 | of extents in each range of free extent sizes. | |
533 | .RS 1.0i | |
534 | .TP 0.4i | |
732f8f5a ES |
535 | .B \-A |
536 | reports only free extents with starting blocks aligned to | |
537 | .I alignment | |
538 | blocks. | |
539 | .TP | |
2017d0d0 BN |
540 | .B \-a |
541 | adds | |
542 | .I ag | |
543 | to the list of allocation groups to be processed. If no | |
544 | .B \-a | |
545 | options are given then all allocation groups are processed. | |
546 | .TP | |
547 | .B \-b | |
548 | specifies that the histogram buckets are binary-sized, with the starting | |
549 | sizes being the powers of 2. | |
550 | .TP | |
551 | .B \-c | |
552 | specifies that | |
553 | .B freesp | |
554 | will search the by-size (cnt) space Btree instead of the default | |
555 | by-block (bno) space Btree. | |
556 | .TP | |
557 | .B \-d | |
558 | specifies that every free extent will be displayed. | |
559 | .TP | |
560 | .B \-e | |
561 | specifies that the histogram buckets are | |
562 | equal-sized, with the size specified as | |
563 | .IR i . | |
564 | .TP | |
565 | .B \-h | |
566 | specifies a starting block number for a histogram bucket as | |
567 | .IR h1 . | |
568 | Multiple | |
569 | .BR \-h 's | |
570 | are given to specify the complete set of buckets. | |
571 | .TP | |
572 | .B \-m | |
573 | specifies that the histogram starting block numbers are powers of | |
574 | .IR m . | |
575 | This is the general case of | |
576 | .BR \-b . | |
577 | .TP | |
578 | .B \-s | |
579 | specifies that a final summary of total free extents, | |
2bd0ea18 | 580 | free blocks, and the average free extent size is printed. |
2017d0d0 | 581 | .RE |
2bd0ea18 | 582 | .TP |
2017d0d0 BN |
583 | .B fsb |
584 | See the | |
585 | .B fsblock | |
586 | command. | |
587 | .TP | |
588 | .BI "fsblock [" fsb ] | |
589 | Set current address to the fsblock value given by | |
590 | .IR fsb . | |
591 | If no value for | |
592 | .I fsb | |
593 | is given the current address is printed, expressed as an fsb. | |
594 | The type is set to | |
595 | .B data | |
596 | (uninterpreted). XFS filesystem block numbers are computed | |
597 | .RI (( agno " << " agshift ") | " agblock ) | |
598 | where | |
599 | .I agshift | |
600 | depends on the size of an allocation group. Use the | |
601 | .B convert | |
602 | command to convert to and from this form. Block numbers given for file blocks | |
603 | (for instance from the | |
604 | .B bmap | |
605 | command) are in this form. | |
606 | .TP | |
86bb49e4 DW |
607 | .BI "fsmap [ " start " ] [ " end " ] |
608 | Prints the mapping of disk blocks used by an XFS filesystem. The map | |
609 | lists each extent used by files, allocation group metadata, | |
610 | journalling logs, and static filesystem metadata, as well as any | |
611 | regions that are unused. All blocks, offsets, and lengths are specified | |
612 | in units of 512-byte blocks, no matter what the filesystem's block size is. | |
613 | .BI "The optional " start " and " end " arguments can be used to constrain | |
614 | the output to a particular range of disk blocks. | |
615 | .TP | |
2017d0d0 BN |
616 | .BI hash " string |
617 | Prints the hash value of | |
618 | .I string | |
619 | using the hash function of the XFS directory and attribute implementation. | |
620 | .TP | |
621 | .BI "help [" command ] | |
2bd0ea18 NS |
622 | Print help for one or all commands. |
623 | .TP | |
2017d0d0 BN |
624 | .BI "inode [" inode# ] |
625 | Set the current inode number. If no | |
626 | .I inode# | |
627 | is given, print the current inode number. | |
2bd0ea18 | 628 | .TP |
2017d0d0 BN |
629 | .BI "label [" label ] |
630 | Set the filesystem label. The filesystem label can be used by | |
631 | .BR mount (8) | |
512cfb8a NS |
632 | instead of using a device special file. |
633 | The maximum length of an XFS label is 12 characters \- use of a longer | |
2017d0d0 BN |
634 | .I label |
635 | will result in truncation and a warning will be issued. If no | |
636 | .I label | |
637 | is given, the current filesystem label is printed. | |
512cfb8a | 638 | .TP |
2017d0d0 BN |
639 | .BI "log [stop | start " filename ] |
640 | Start logging output to | |
641 | .IR filename , | |
642 | stop logging, or print the current logging status. | |
2bd0ea18 | 643 | .TP |
2017d0d0 | 644 | .BI "metadump [\-egow] " filename |
61983f67 | 645 | Dumps metadata to a file. See |
2017d0d0 BN |
646 | .BR xfs_metadump (8) |
647 | for more information. | |
648 | .TP | |
649 | .BI "ncheck [\-s] [\-i " ino "] ..." | |
650 | Print name-inode pairs. A | |
651 | .B blockget \-n | |
652 | command must be run first to gather the information. | |
653 | .RS 1.0i | |
654 | .TP 0.4i | |
655 | .B \-i | |
656 | specifies an inode number to be printed. If no | |
657 | .B \-i | |
658 | options are given then all inodes are printed. | |
659 | .TP | |
660 | .B \-s | |
661 | specifies that only setuid and setgid files are printed. | |
662 | .RE | |
663 | .TP | |
664 | .B p | |
665 | See the | |
666 | .B print | |
667 | command. | |
2bd0ea18 | 668 | .TP |
2017d0d0 | 669 | .B pop |
2bd0ea18 NS |
670 | Pop location from the stack. |
671 | .TP | |
2017d0d0 | 672 | .BI "print [" field-expression "] ..." |
2bd0ea18 NS |
673 | Print field values. |
674 | If no argument is given, print all fields in the current structure. | |
675 | .TP | |
2017d0d0 BN |
676 | .BI "push [" command ] |
677 | Push location to the stack. If | |
678 | .I command | |
679 | is supplied, set the current location to the results of | |
680 | .I command | |
2bd0ea18 NS |
681 | after pushing the old location. |
682 | .TP | |
2017d0d0 BN |
683 | .B q |
684 | See the | |
685 | .B quit | |
686 | command. | |
687 | .TP | |
688 | .B quit | |
689 | Exit | |
690 | .BR xfs_db . | |
691 | .TP | |
692 | .BI "ring [" index ] | |
693 | Show position ring (if no | |
694 | .I index | |
695 | argument is given), or move to a specific entry in the position ring given by | |
696 | .IR index . | |
697 | .TP | |
698 | .BI "sb [" agno ] | |
699 | Set current address to SB header in allocation group | |
700 | .IR agno . | |
701 | If no | |
702 | .I agno | |
967d4e13 | 703 | is given, use the current allocation group number. |
2017d0d0 BN |
704 | .TP |
705 | .BI "source " source-file | |
706 | Process commands from | |
707 | .IR source-file . | |
708 | .B source | |
709 | commands can be nested. | |
710 | .TP | |
711 | .B stack | |
2bd0ea18 NS |
712 | View the location stack. |
713 | .TP | |
2017d0d0 BN |
714 | .BI "type [" type ] |
715 | Set the current data type to | |
716 | .IR type . | |
2bd0ea18 NS |
717 | If no argument is given, show the current data type. |
718 | The possible data types are: | |
2017d0d0 BN |
719 | .BR agf ", " agfl ", " agi ", " attr ", " bmapbta ", " bmapbtd , |
720 | .BR bnobt ", " cntbt ", " data ", " dir ", " dir2 ", " dqblk , | |
9fb2cb27 DW |
721 | .BR inobt ", " inode ", " log ", " refcntbt ", " rmapbt ", " rtbitmap , |
722 | .BR rtsummary ", " sb ", " symlink " and " text . | |
2bd0ea18 NS |
723 | See the TYPES section below for more information on these data types. |
724 | .TP | |
9c4e12fb | 725 | .BI "uuid [" uuid " | " generate " | " rewrite " | " restore ] |
512cfb8a NS |
726 | Set the filesystem universally unique identifier (UUID). |
727 | The filesystem UUID can be used by | |
2017d0d0 | 728 | .BR mount (8) |
512cfb8a | 729 | instead of using a device special file. |
2017d0d0 BN |
730 | The |
731 | .I uuid | |
732 | can be set directly to the desired UUID, or it can | |
733 | be automatically generated using the | |
734 | .B generate | |
735 | option. These options will both write the UUID into every copy of the | |
9c4e12fb ES |
736 | superblock in the filesystem. On a CRC-enabled filesystem, this will |
737 | set an incompatible superblock flag, and the filesystem will not be | |
738 | mountable with older kernels. This can be reverted with the | |
739 | .B restore | |
740 | option, which will copy the original UUID back into place and clear | |
741 | the incompatible flag as needed. | |
2017d0d0 BN |
742 | .B rewrite |
743 | copies the current UUID from the primary superblock | |
512cfb8a NS |
744 | to all secondary copies of the superblock. |
745 | If no argument is given, the current filesystem UUID is printed. | |
746 | .TP | |
2017d0d0 | 747 | .BI "version [" feature " | " "versionnum features2" ] |
4ca431fc NS |
748 | Enable selected features for a filesystem (certain features can |
749 | be enabled on an unmounted filesystem, after | |
2017d0d0 | 750 | .BR mkfs.xfs (8) |
4ca431fc | 751 | has created the filesystem). |
2017d0d0 BN |
752 | Support for unwritten extents can be enabled using the |
753 | .B extflg | |
754 | option. Support for version 2 log format can be enabled using the | |
755 | .B log2 | |
756 | option. Support for extended attributes can be enabled using the | |
757 | .B attr1 | |
758 | or | |
759 | .B attr2 | |
760 | option. Once enabled, extended attributes cannot be disabled, but the user | |
761 | may toggle between | |
762 | .B attr1 | |
763 | and | |
764 | .B attr2 | |
765 | at will (older kernels may not support the newer version). | |
766 | .IP | |
767 | If no argument is given, the current version and feature bits are printed. | |
d2df702b NS |
768 | With one argument, this command will write the updated version number |
769 | into every copy of the superblock in the filesystem. | |
d2df702b | 770 | If two arguments are given, they will be used as numeric values for the |
2017d0d0 BN |
771 | .I versionnum |
772 | and | |
773 | .I features2 | |
774 | bits respectively, and their string equivalent reported | |
775 | (but no modifications are made). | |
4ca431fc | 776 | .TP |
ca138928 | 777 | .BI "write [\-c] [\-d] [" "field value" "] ..." |
2bd0ea18 NS |
778 | Write a value to disk. |
779 | Specific fields can be set in structures (struct mode), | |
780 | or a block can be set to data values (data mode), | |
781 | or a block can be set to string values (string mode, for symlink blocks). | |
782 | The operation happens immediately: there is no buffering. | |
2017d0d0 | 783 | .IP |
2bd0ea18 | 784 | Struct mode is in effect when the current type is structural, |
2017d0d0 BN |
785 | i.e. not data. For struct mode, the syntax is "\c |
786 | .B write | |
787 | .I field value\c | |
788 | ". | |
789 | .IP | |
790 | Data mode is in effect when the current type is data. In this case the | |
791 | contents of the block can be shifted or rotated left or right, or filled | |
792 | with a sequence, a constant value, or a random value. In this mode | |
793 | .B write | |
794 | with no arguments gives more information on the allowed commands. | |
c9f5e3db ES |
795 | .RS 1.0i |
796 | .TP 0.4i | |
797 | .B \-c | |
798 | Skip write verifiers and CRC recalculation; allows invalid data to be written | |
799 | to disk. | |
ca138928 DW |
800 | .TP 0.4i |
801 | .B \-d | |
802 | Skip write verifiers but perform CRC recalculation. | |
803 | This allows invalid data to be written to disk to | |
804 | test detection of invalid data. (This is not possible for some types.) | |
c9f5e3db | 805 | .RE |
2bd0ea18 NS |
806 | .SH TYPES |
807 | This section gives the fields in each structure type and their meanings. | |
808 | Note that some types of block cover multiple actual structures, | |
809 | for instance directory blocks. | |
2017d0d0 BN |
810 | .TP 1.0i |
811 | .B agf | |
2bd0ea18 NS |
812 | The AGF block is the header for block allocation information; |
813 | it is in the second 512-byte block of each allocation group. | |
814 | The following fields are defined: | |
2017d0d0 BN |
815 | .RS 1.4i |
816 | .PD 0 | |
817 | .TP 1.2i | |
818 | .B magicnum | |
819 | AGF block magic number, 0x58414746 ('XAGF'). | |
820 | .TP | |
821 | .B versionnum | |
822 | version number, currently 1. | |
823 | .TP | |
824 | .B seqno | |
825 | sequence number starting from 0. | |
826 | .TP | |
827 | .B length | |
828 | size in filesystem blocks of the allocation group. All allocation | |
829 | groups except the last one of the filesystem have the superblock's | |
830 | .B agblocks | |
831 | value here. | |
832 | .TP | |
833 | .B bnoroot | |
834 | block number of the root of the Btree holding free space | |
835 | information sorted by block number. | |
2bd0ea18 | 836 | .TP |
2017d0d0 BN |
837 | .B cntroot |
838 | block number of the root of the Btree holding free space | |
839 | information sorted by block count. | |
840 | .TP | |
841 | .B bnolevel | |
842 | number of levels in the by-block-number Btree. | |
843 | .TP | |
844 | .B cntlevel | |
845 | number of levels in the by-block-count Btree. | |
846 | .TP | |
847 | .B flfirst | |
848 | index into the AGFL block of the first active entry. | |
849 | .TP | |
850 | .B fllast | |
851 | index into the AGFL block of the last active entry. | |
852 | .TP | |
853 | .B flcount | |
854 | count of active entries in the AGFL block. | |
855 | .TP | |
856 | .B freeblks | |
857 | count of blocks represented in the freespace Btrees. | |
858 | .TP | |
859 | .B longest | |
860 | longest free space represented in the freespace Btrees. | |
861 | .TP | |
862 | .B btreeblks | |
863 | number of blocks held in the AGF Btrees. | |
864 | .PD | |
865 | .RE | |
866 | .TP | |
967d4e13 | 867 | .B agfl |
2bd0ea18 NS |
868 | The AGFL block contains block numbers for use of the block allocator; |
869 | it is in the fourth 512-byte block of each allocation group. | |
870 | Each entry in the active list is a block number within the allocation group | |
871 | that can be used for any purpose if space runs low. | |
2017d0d0 BN |
872 | The AGF block fields |
873 | .BR flfirst ", " fllast ", and " flcount | |
2bd0ea18 NS |
874 | designate which entries are currently active. |
875 | Entry space is allocated in a circular manner within the AGFL block. | |
876 | Fields defined: | |
2017d0d0 BN |
877 | .RS 1.4i |
878 | .PD 0 | |
879 | .TP 1.2i | |
880 | .B bno | |
881 | array of all block numbers. Even those which are not active are printed. | |
882 | .PD | |
883 | .RE | |
884 | .TP | |
885 | .B agi | |
2bd0ea18 NS |
886 | The AGI block is the header for inode allocation information; |
887 | it is in the third 512-byte block of each allocation group. | |
888 | Fields defined: | |
2017d0d0 BN |
889 | .RS 1.4i |
890 | .PD 0 | |
891 | .TP 1.2i | |
892 | .B magicnum | |
893 | AGI block magic number, 0x58414749 ('XAGI'). | |
894 | .TP | |
895 | .B versionnum | |
896 | version number, currently 1. | |
897 | .TP | |
898 | .B seqno | |
899 | sequence number starting from 0. | |
900 | .TP | |
901 | .B length | |
902 | size in filesystem blocks of the allocation group. | |
903 | .TP | |
904 | .B count | |
905 | count of inodes allocated. | |
906 | .TP | |
907 | .B root | |
908 | block number of the root of the Btree holding inode allocation information. | |
909 | .TP | |
910 | .B level | |
911 | number of levels in the inode allocation Btree. | |
912 | .TP | |
913 | .B freecount | |
914 | count of allocated inodes that are not in use. | |
915 | .TP | |
916 | .B newino | |
917 | last inode number allocated. | |
918 | .TP | |
919 | .B dirino | |
920 | unused. | |
921 | .TP | |
922 | .B unlinked | |
923 | an array of inode numbers within the allocation group. The entries | |
924 | in the AGI block are the heads of lists which run through the inode | |
925 | .B next_unlinked | |
926 | field. These inodes are to be unlinked the next time the filesystem is mounted. | |
927 | .PD | |
928 | .RE | |
929 | .TP | |
930 | .B attr | |
931 | An attribute fork is organized as a Btree with the actual data embedded | |
932 | in the leaf blocks. The root of the Btree is found in block 0 of the fork. | |
2bd0ea18 | 933 | The index (sort order) of the Btree is the hash value of the attribute name. |
2017d0d0 BN |
934 | All the blocks contain a |
935 | .B blkinfo | |
936 | structure at the beginning, see type | |
937 | .B dir | |
938 | for a description. Nonleaf blocks are identical in format to those for | |
939 | version 1 and version 2 directories, see type | |
940 | .B dir | |
941 | for a description. Leaf blocks can refer to "local" or "remote" attribute | |
942 | values. Local values are stored directly in the leaf block. | |
29b90b5b | 943 | Leaf blocks contain the following fields: |
2017d0d0 BN |
944 | .RS 1.4i |
945 | .PD 0 | |
946 | .TP 1.2i | |
947 | .B hdr | |
948 | header containing a | |
949 | .B blkinfo | |
950 | structure | |
951 | .B info | |
952 | (magic number 0xfbee), a | |
953 | .B count | |
954 | of active entries, | |
955 | .B usedbytes | |
956 | total bytes of names and values, the | |
957 | .B firstused | |
958 | byte in the name area, | |
959 | .B holes | |
960 | set if the block needs compaction, and array | |
961 | .B freemap | |
962 | as for | |
963 | .B dir | |
964 | leaf blocks. | |
965 | .TP | |
966 | .B entries | |
967 | array of structures containing a | |
968 | .BR hashval , | |
969 | .B nameidx | |
970 | (index into the block of the name), and flags | |
971 | .BR incomplete , | |
972 | .BR root , | |
973 | and | |
974 | .BR local . | |
975 | .TP | |
976 | .B nvlist | |
977 | array of structures describing the attribute names and values. Fields | |
978 | always present: | |
979 | .B valuelen | |
980 | (length of value in bytes), | |
981 | .BR namelen , | |
982 | and | |
983 | .BR name . | |
2bd0ea18 | 984 | Fields present for local values: |
2017d0d0 BN |
985 | .B value |
986 | (value string). Fields present for remote values: | |
987 | .B valueblk | |
988 | (fork block number of containing the value). | |
989 | .PD | |
990 | .RE | |
29b90b5b DW |
991 | .IP |
992 | Remote values are stored in an independent block in the attribute fork. | |
993 | Prior to v5, value blocks had no structure, but in v5 they acquired a header | |
994 | structure with the following fields: | |
995 | .RS 1.4i | |
996 | .PD 0 | |
997 | .TP 1.2i | |
998 | .B magic | |
999 | attr3 remote block magic number, 0x5841524d ('XARM'). | |
1000 | .TP | |
1001 | .B offset | |
1002 | Byte offset of this data block within the overall attribute value. | |
1003 | .TP | |
1004 | .B bytes | |
1005 | Number of bytes stored in this block. | |
1006 | .TP | |
1007 | .B crc | |
1008 | Checksum of the attribute block contents. | |
1009 | .TP | |
1010 | .B uuid | |
1011 | Filesystem UUID. | |
1012 | .TP | |
1013 | .B owner | |
1014 | Inode that owns this attribute value. | |
1015 | .TP | |
1016 | .B bno | |
1017 | Block offset of this block within the inode's attribute fork. | |
1018 | .TP | |
1019 | .B lsn | |
1020 | Log serial number of the last time this block was logged. | |
1021 | .TP | |
1022 | .B data | |
1023 | The attribute value data. | |
1024 | .PD | |
1025 | .RE | |
2017d0d0 BN |
1026 | .TP |
1027 | .B bmapbt | |
2bd0ea18 NS |
1028 | Files with many extents in their data or attribute fork will have the |
1029 | extents described by the contents of a Btree for that fork, | |
1030 | instead of being stored directly in the inode. | |
1031 | Each bmap Btree starts with a root block contained within the inode. | |
1032 | The other levels of the Btree are stored in filesystem blocks. | |
1033 | The blocks are linked to sibling left and right blocks at each level, | |
1034 | as well as by pointers from parent to child blocks. | |
1035 | Each block contains the following fields: | |
2017d0d0 BN |
1036 | .RS 1.4i |
1037 | .PD 0 | |
1038 | .TP 1.2i | |
1039 | .B magic | |
1040 | bmap Btree block magic number, 0x424d4150 ('BMAP'). | |
1041 | .TP | |
1042 | .B level | |
1043 | level of this block above the leaf level. | |
1044 | .TP | |
1045 | .B numrecs | |
1046 | number of records or keys in the block. | |
1047 | .TP | |
1048 | .B leftsib | |
1049 | left (logically lower) sibling block, 0 if none. | |
1050 | .TP | |
1051 | .B rightsib | |
1052 | right (logically higher) sibling block, 0 if none. | |
1053 | .TP | |
1054 | .B recs | |
1055 | [leaf blocks only] array of extent records. | |
d2df702b | 1056 | Each record contains |
2017d0d0 BN |
1057 | .BR startoff , |
1058 | .BR startblock , | |
1059 | .BR blockcount , | |
1060 | and | |
1061 | .B extentflag | |
1062 | (1 if the extent is unwritten). | |
1063 | .TP | |
1064 | .B keys | |
87342c3a | 1065 | [non-leaf blocks only] array of key records. These are the first key |
2017d0d0 BN |
1066 | value of each block in the level below this one. Each record contains |
1067 | .BR startoff . | |
1068 | .TP | |
1069 | .B ptrs | |
87342c3a | 1070 | [non-leaf blocks only] array of child block pointers. |
2017d0d0 BN |
1071 | Each pointer is a filesystem block number to the next level in the Btree. |
1072 | .PD | |
1073 | .RE | |
1074 | .TP | |
1075 | .B bnobt | |
1076 | There is one set of filesystem blocks forming the by-block-number | |
1077 | allocation Btree for each allocation group. The root block of this | |
1078 | Btree is designated by the | |
1079 | .B bnoroot | |
87342c3a | 1080 | field in the corresponding AGF block. |
2bd0ea18 NS |
1081 | The blocks are linked to sibling left and right blocks at each level, |
1082 | as well as by pointers from parent to child blocks. | |
1083 | Each block has the following fields: | |
2017d0d0 BN |
1084 | .RS 1.4i |
1085 | .PD 0 | |
1086 | .TP 1.2i | |
1087 | .B magic | |
1088 | BNOBT block magic number, 0x41425442 ('ABTB'). | |
1089 | .TP | |
1090 | .B level | |
1091 | level number of this block, 0 is a leaf. | |
1092 | .TP | |
1093 | .B numrecs | |
1094 | number of data entries in the block. | |
1095 | .TP | |
1096 | .B leftsib | |
1097 | left (logically lower) sibling block, 0 if none. | |
1098 | .TP | |
1099 | .B rightsib | |
1100 | right (logically higher) sibling block, 0 if none. | |
1101 | .TP | |
1102 | .B recs | |
1103 | [leaf blocks only] array of freespace records. Each record contains | |
1104 | .B startblock | |
1105 | and | |
1106 | .BR blockcount . | |
1107 | .TP | |
1108 | .B keys | |
87342c3a | 1109 | [non-leaf blocks only] array of key records. These are the first value |
2017d0d0 BN |
1110 | of each block in the level below this one. Each record contains |
1111 | .B startblock | |
1112 | and | |
1113 | .BR blockcount . | |
1114 | .TP | |
1115 | .B ptrs | |
87342c3a | 1116 | [non-leaf blocks only] array of child block pointers. Each pointer is a |
2017d0d0 BN |
1117 | block number within the allocation group to the next level in the Btree. |
1118 | .PD | |
1119 | .RE | |
1120 | .TP | |
1121 | .B cntbt | |
1122 | There is one set of filesystem blocks forming the by-block-count | |
1123 | allocation Btree for each allocation group. The root block of this | |
1124 | Btree is designated by the | |
1125 | .B cntroot | |
87342c3a | 1126 | field in the corresponding AGF block. The blocks are linked to sibling |
2017d0d0 BN |
1127 | left and right blocks at each level, as well as by pointers from parent |
1128 | to child blocks. Each block has the following fields: | |
1129 | .RS 1.4i | |
1130 | .PD 0 | |
1131 | .TP 1.2i | |
1132 | .B magic | |
1133 | CNTBT block magic number, 0x41425443 ('ABTC'). | |
1134 | .TP | |
1135 | .B level | |
1136 | level number of this block, 0 is a leaf. | |
1137 | .TP | |
1138 | .B numrecs | |
1139 | number of data entries in the block. | |
1140 | .TP | |
1141 | .B leftsib | |
1142 | left (logically lower) sibling block, 0 if none. | |
1143 | .TP | |
1144 | .B rightsib | |
1145 | right (logically higher) sibling block, 0 if none. | |
1146 | .TP | |
1147 | .B recs | |
1148 | [leaf blocks only] array of freespace records. Each record contains | |
1149 | .B startblock | |
1150 | and | |
1151 | .BR blockcount . | |
1152 | .TP | |
1153 | .B keys | |
87342c3a | 1154 | [non-leaf blocks only] array of key records. These are the first value |
2017d0d0 BN |
1155 | of each block in the level below this one. Each record contains |
1156 | .B blockcount | |
1157 | and | |
1158 | .BR startblock . | |
1159 | .TP | |
1160 | .B ptrs | |
87342c3a | 1161 | [non-leaf blocks only] array of child block pointers. Each pointer is a |
2017d0d0 BN |
1162 | block number within the allocation group to the next level in the Btree. |
1163 | .PD | |
1164 | .RE | |
1165 | .TP | |
1166 | .B data | |
1167 | User file blocks, and other blocks whose type is unknown, have this | |
1168 | type for display purposes in | |
1169 | .BR xfs_db . | |
2bd0ea18 NS |
1170 | The block data is displayed in hexadecimal format. |
1171 | .TP | |
2017d0d0 | 1172 | .B dir |
2bd0ea18 | 1173 | A version 1 directory is organized as a Btree with the directory data |
2017d0d0 BN |
1174 | embedded in the leaf blocks. The root of the Btree is found in block 0 |
1175 | of the file. The index (sort order) of the Btree is the hash value of | |
1176 | the entry name. All the blocks contain a | |
1177 | .B blkinfo | |
1178 | structure at the beginning with the following fields: | |
1179 | .RS 1.4i | |
1180 | .PD 0 | |
1181 | .TP 1.2i | |
1182 | .B forw | |
1183 | next sibling block. | |
1184 | .TP | |
1185 | .B back | |
1186 | previous sibling block. | |
1187 | .TP | |
1188 | .B magic | |
1189 | magic number for this block type. | |
1190 | .RE | |
1191 | .IP | |
1192 | ||
1193 | The non-leaf (node) blocks have the following fields: | |
1194 | .RS 1.4i | |
1195 | .TP 1.2i | |
1196 | .B hdr | |
1197 | header containing a | |
1198 | .B blkinfo | |
1199 | structure | |
1200 | .B info | |
1201 | (magic number 0xfebe), the | |
1202 | .B count | |
1203 | of active entries, and the | |
1204 | .B level | |
1205 | of this block above the leaves. | |
1206 | .TP | |
1207 | .B btree | |
1208 | array of entries containing | |
1209 | .B hashval | |
1210 | and | |
1211 | .B before | |
1212 | fields. The | |
1213 | .B before | |
1214 | value is a block number within the directory file to the child block, the | |
1215 | .B hashval | |
1216 | is the last hash value in that block. | |
1217 | .RE | |
1218 | .IP | |
1219 | ||
2bd0ea18 | 1220 | The leaf blocks have the following fields: |
2017d0d0 BN |
1221 | .RS 1.4i |
1222 | .TP 1.2i | |
1223 | .B hdr | |
1224 | header containing a | |
1225 | .B blkinfo | |
1226 | structure | |
1227 | .B info | |
1228 | (magic number 0xfeeb), the | |
1229 | .B count | |
1230 | of active entries, | |
1231 | .B namebytes | |
1232 | (total name string bytes), | |
1233 | .B holes | |
1234 | flag (block needs compaction), and | |
1235 | .B freemap | |
1236 | (array of | |
1237 | .BR base ", " size | |
1238 | entries for free regions). | |
1239 | .TP | |
1240 | .B entries | |
1241 | array of structures containing | |
1242 | .BR hashval , | |
1243 | .B nameidx | |
1244 | (byte index into the block of the name string), and | |
1245 | .BR namelen . | |
1246 | .TP | |
1247 | .B namelist | |
1248 | array of structures containing | |
1249 | .B inumber | |
1250 | and | |
1251 | .BR name . | |
1252 | .RE | |
1253 | .PD | |
1254 | .TP | |
1255 | .B dir2 | |
2bd0ea18 NS |
1256 | A version 2 directory has four kinds of blocks. |
1257 | Data blocks start at offset 0 in the file. | |
1258 | There are two kinds of data blocks: single-block directories have | |
1259 | the leaf information embedded at the end of the block, data blocks | |
1260 | in multi-block directories do not. | |
062998e3 | 1261 | Node and leaf blocks start at offset 32GiB (with either a single |
2bd0ea18 | 1262 | leaf block or the root node block). |
062998e3 | 1263 | Freespace blocks start at offset 64GiB. |
2bd0ea18 NS |
1264 | The node and leaf blocks form a Btree, with references to the data |
1265 | in the data blocks. | |
1266 | The freespace blocks form an index of longest free spaces within the | |
1267 | data blocks. | |
2017d0d0 | 1268 | .IP |
2bd0ea18 | 1269 | A single-block directory block contains the following fields: |
2017d0d0 BN |
1270 | .RS 1.4i |
1271 | .PD 0 | |
1272 | .TP 1.2i | |
1273 | .B bhdr | |
1274 | header containing | |
1275 | .B magic | |
1276 | number 0x58443242 ('XD2B') and an array | |
1277 | .B bestfree | |
1278 | of the longest 3 free spaces in the block | |
1279 | .RB ( offset ", " length ). | |
1280 | .TP | |
1281 | .B bu | |
1282 | array of union structures. Each element is either an entry or a freespace. | |
2bd0ea18 | 1283 | For entries, there are the following fields: |
2017d0d0 BN |
1284 | .BR inumber , |
1285 | .BR namelen , | |
1286 | .BR name , | |
1287 | and | |
1288 | .BR tag . | |
2bd0ea18 | 1289 | For freespace, there are the following fields: |
2017d0d0 BN |
1290 | .B freetag |
1291 | (0xffff), | |
1292 | .BR length , | |
1293 | and | |
1294 | .BR tag . | |
1295 | The | |
1296 | .B tag | |
1297 | value is the byte offset in the block of the start of the entry it | |
1298 | is contained in. | |
1299 | .TP | |
1300 | .B bleaf | |
1301 | array of leaf entries containing | |
1302 | .B hashval | |
1303 | and | |
1304 | .BR address . | |
1305 | The | |
1306 | .B address | |
1307 | is a 64-bit word offset into the file. | |
1308 | .TP | |
1309 | .B btail | |
1310 | tail structure containing the total | |
1311 | .B count | |
1312 | of leaf entries and | |
1313 | .B stale | |
1314 | count of unused leaf entries. | |
1315 | .RE | |
1316 | .IP | |
1317 | ||
2bd0ea18 | 1318 | A data block contains the following fields: |
2017d0d0 BN |
1319 | .RS 1.4i |
1320 | .TP 1.2i | |
1321 | .B dhdr | |
d2df702b | 1322 | header containing |
2017d0d0 BN |
1323 | .B magic |
1324 | number 0x58443244 ('XD2D') and an array | |
1325 | .B bestfree | |
1326 | of the longest 3 free spaces in the block | |
1327 | .RB ( offset ", " length ). | |
1328 | .TP | |
1329 | .B du | |
1330 | array of union structures as for | |
1331 | .BR bu . | |
1332 | .RE | |
1333 | .IP | |
1334 | ||
1335 | Leaf blocks have two possible forms. If the Btree consists of a single | |
1336 | leaf then the freespace information is in the leaf block, | |
2bd0ea18 | 1337 | otherwise it is in separate blocks and the root of the Btree is |
2017d0d0 BN |
1338 | a node block. A leaf block contains the following fields: |
1339 | .RS 1.4i | |
1340 | .TP 1.2i | |
1341 | .B lhdr | |
1342 | header containing a | |
1343 | .B blkinfo | |
1344 | structure | |
1345 | .B info | |
1346 | (magic number 0xd2f1 for the single leaf case, 0xd2ff for the true | |
1347 | Btree case), the total | |
1348 | .B count | |
1349 | of leaf entries, and | |
1350 | .B stale | |
1351 | count of unused leaf entries. | |
1352 | .TP | |
1353 | .B lents | |
1354 | leaf entries, as for | |
1355 | .BR bleaf . | |
1356 | .TP | |
1357 | .B lbests | |
1358 | [single leaf only] array of values which represent the longest freespace | |
1359 | in each data block in the directory. | |
1360 | .TP | |
1361 | .B ltail | |
1362 | [single leaf only] tail structure containing | |
1363 | .B bestcount | |
1364 | count of | |
1365 | .BR lbests . | |
1366 | .RE | |
1367 | .IP | |
1368 | ||
1369 | A node block is identical to that for types | |
1370 | .B attr | |
1371 | and | |
1372 | .BR dir . | |
1373 | ||
2bd0ea18 | 1374 | A freespace block contains the following fields: |
2017d0d0 BN |
1375 | .RS 1.4i |
1376 | .TP 1.2i | |
1377 | .B fhdr | |
1378 | header containing | |
1379 | .B magic | |
1380 | number 0x58443246 ('XD2F'), | |
1381 | .B firstdb | |
1382 | first data block number covered by this freespace block, | |
1383 | .B nvalid | |
1384 | number of valid entries, and | |
1385 | .B nused | |
1386 | number of entries representing real data blocks. | |
1387 | .TP | |
1388 | .B fbests | |
1389 | array of values as for | |
1390 | .BR lbests . | |
1391 | .PD | |
1392 | .RE | |
1393 | .TP | |
1394 | .B dqblk | |
2bd0ea18 | 1395 | The quota information is stored in files referred to by the superblock |
2017d0d0 BN |
1396 | .B uquotino |
1397 | and | |
1398 | .B pquotino | |
1399 | fields. Each filesystem block in a quota file contains a constant number of | |
1400 | quota entries. The quota entry size is currently 136 bytes, so with a 4KiB | |
1401 | filesystem block size there are 30 quota entries per block. The | |
1402 | .B dquot | |
1403 | command is used to locate these entries in the filesystem. | |
2bd0ea18 NS |
1404 | The file entries are indexed by the user or project identifier |
1405 | to determine the block and offset. | |
1406 | Each quota entry has the following fields: | |
2017d0d0 BN |
1407 | .RS 1.4i |
1408 | .PD 0 | |
1409 | .TP 1.5i | |
1410 | .B magic | |
1411 | magic number, 0x4451 ('DQ'). | |
1412 | .TP | |
1413 | .B version | |
1414 | version number, currently 1. | |
1415 | .TP | |
1416 | .B flags | |
1417 | flags, values include 0x01 for user quota, 0x02 for project quota. | |
1418 | .TP | |
1419 | .B id | |
1420 | user or project identifier. | |
1421 | .TP | |
1422 | .B blk_hardlimit | |
1423 | absolute limit on blocks in use. | |
1424 | .TP | |
1425 | .B blk_softlimit | |
1426 | preferred limit on blocks in use. | |
1427 | .TP | |
1428 | .B ino_hardlimit | |
1429 | absolute limit on inodes in use. | |
1430 | .TP | |
1431 | .B ino_softlimit | |
1432 | preferred limit on inodes in use. | |
1433 | .TP | |
1434 | .B bcount | |
1435 | blocks actually in use. | |
1436 | .TP | |
1437 | .B icount | |
1438 | inodes actually in use. | |
1439 | .TP | |
1440 | .B itimer | |
1441 | time when service will be refused if soft limit is violated for inodes. | |
1442 | .TP | |
1443 | .B btimer | |
1444 | time when service will be refused if soft limit is violated for blocks. | |
1445 | .TP | |
1446 | .B iwarns | |
1447 | number of warnings issued about inode limit violations. | |
1448 | .TP | |
1449 | .B bwarns | |
1450 | number of warnings issued about block limit violations. | |
1451 | .TP | |
1452 | .B rtb_hardlimit | |
1453 | absolute limit on realtime blocks in use. | |
1454 | .TP | |
1455 | .B rtb_softlimit | |
1456 | preferred limit on realtime blocks in use. | |
1457 | .TP | |
1458 | .B rtbcount | |
1459 | realtime blocks actually in use. | |
2bd0ea18 | 1460 | .TP |
2017d0d0 BN |
1461 | .B rtbtimer |
1462 | time when service will be refused if soft limit is violated for realtime blocks. | |
1463 | .TP | |
1464 | .B rtbwarns | |
1465 | number of warnings issued about realtime block limit violations. | |
1466 | .PD | |
1467 | .RE | |
1468 | .TP | |
1469 | .B inobt | |
1470 | There is one set of filesystem blocks forming the inode allocation Btree for | |
1471 | each allocation group. The root block of this Btree is designated by the | |
1472 | .B root | |
87342c3a | 1473 | field in the corresponding AGI block. |
2bd0ea18 NS |
1474 | The blocks are linked to sibling left and right blocks at each level, |
1475 | as well as by pointers from parent to child blocks. | |
1476 | Each block has the following fields: | |
2017d0d0 BN |
1477 | .RS 1.4i |
1478 | .PD 0 | |
1479 | .TP 1.2i | |
1480 | .B magic | |
1481 | INOBT block magic number, 0x49414254 ('IABT'). | |
1482 | .TP | |
1483 | .B level | |
1484 | level number of this block, 0 is a leaf. | |
1485 | .TP | |
1486 | .B numrecs | |
1487 | number of data entries in the block. | |
1488 | .TP | |
1489 | .B leftsib | |
1490 | left (logically lower) sibling block, 0 if none. | |
1491 | .TP | |
1492 | .B rightsib | |
1493 | right (logically higher) sibling block, 0 if none. | |
1494 | .TP | |
1495 | .B recs | |
1496 | [leaf blocks only] array of inode records. Each record contains | |
1497 | .B startino | |
1498 | allocation-group relative inode number, | |
1499 | .B freecount | |
1500 | count of free inodes in this chunk, and | |
1501 | .B free | |
1502 | bitmap, LSB corresponds to inode 0. | |
1503 | .TP | |
1504 | .B keys | |
87342c3a | 1505 | [non-leaf blocks only] array of key records. These are the first value of each |
2017d0d0 BN |
1506 | block in the level below this one. Each record contains |
1507 | .BR startino . | |
1508 | .TP | |
1509 | .B ptrs | |
87342c3a | 1510 | [non-leaf blocks only] array of child block pointers. Each pointer is a |
2017d0d0 BN |
1511 | block number within the allocation group to the next level in the Btree. |
1512 | .PD | |
1513 | .RE | |
1514 | .TP | |
1515 | .B inode | |
1516 | Inodes are allocated in "chunks" of 64 inodes each. Usually a chunk is | |
1517 | multiple filesystem blocks, although there are cases with large filesystem | |
1518 | blocks where a chunk is less than one block. The inode Btree (see | |
1519 | .B inobt | |
1520 | above) refers to the inode numbers per allocation group. The inode numbers | |
1521 | directly reflect the location of the inode block on disk. Use the | |
1522 | .B inode | |
1523 | command to point | |
1524 | .B xfs_db | |
1525 | to a specific inode. Each inode contains four regions: | |
1526 | .BR core , | |
1527 | .BR next_unlinked , | |
1528 | .BR u ", and " | |
1529 | .BR a . | |
1530 | .B core | |
1531 | contains the fixed information. | |
1532 | .B next_unlinked | |
1533 | is separated from the core due to journaling considerations, see type | |
1534 | .B agi | |
1535 | field | |
1536 | .BR unlinked . | |
1537 | .B u | |
1538 | is a union structure that is different in size and format depending | |
1539 | on the type and representation of the file data ("data fork"). | |
1540 | .B a | |
1541 | is an optional union structure to describe attribute data, | |
2bd0ea18 | 1542 | that is different in size, format, and location depending on the presence |
2017d0d0 BN |
1543 | and representation of attribute data, and the size of the |
1544 | .B u | |
1545 | data ("attribute fork"). | |
1546 | .B xfs_db | |
1547 | automatically selects the proper union members based on information | |
1548 | in the inode. | |
1549 | .IP | |
2bd0ea18 | 1550 | The following are fields in the inode core: |
2017d0d0 BN |
1551 | .RS 1.4i |
1552 | .PD 0 | |
1553 | .TP 1.2i | |
1554 | .B magic | |
1555 | inode magic number, 0x494e ('IN'). | |
2bd0ea18 | 1556 | .TP |
2017d0d0 BN |
1557 | .B mode |
1558 | mode and type of file, as described in | |
1559 | .BR chmod (2), | |
1560 | .BR mknod (2), | |
1561 | and | |
1562 | .BR stat (2). | |
1563 | .TP | |
1564 | .B version | |
1565 | inode version, 1 or 2. | |
1566 | .TP | |
1567 | .B format | |
1568 | format of | |
1569 | .B u | |
1570 | union data (0: xfs_dev_t, 1: local file \- in-inode directory or symlink, | |
1571 | 2: extent list, 3: Btree root, 4: unique id [unused]). | |
1572 | .TP | |
1573 | .B nlinkv1 | |
1574 | number of links to the file in a version 1 inode. | |
1575 | .TP | |
1576 | .B nlinkv2 | |
1577 | number of links to the file in a version 2 inode. | |
1578 | .TP | |
22bc10ed AM |
1579 | .B projid_lo |
1580 | owner's project id (low word; version 2 inode only). | |
1581 | .B projid_hi | |
1582 | owner's project id (high word; version 2 inode only). | |
2017d0d0 BN |
1583 | .TP |
1584 | .B uid | |
1585 | owner's user id. | |
1586 | .TP | |
1587 | .B gid | |
1588 | owner's group id. | |
1589 | .TP | |
1590 | .B atime | |
1591 | time last accessed (seconds and nanoseconds). | |
1592 | .TP | |
1593 | .B mtime | |
1594 | time last modified. | |
1595 | .TP | |
1596 | .B ctime | |
1597 | time created or inode last modified. | |
1598 | .TP | |
1599 | .B size | |
1600 | number of bytes in the file. | |
1601 | .TP | |
1602 | .B nblocks | |
1603 | total number of blocks in the file including indirect and attribute. | |
1604 | .TP | |
1605 | .B extsize | |
1606 | basic/minimum extent size for the file. | |
1607 | .TP | |
1608 | .B nextents | |
1609 | number of extents in the data fork. | |
1610 | .TP | |
1611 | .B naextents | |
1612 | number of extents in the attribute fork. | |
1613 | .TP | |
1614 | .B forkoff | |
1615 | attribute fork offset in the inode, in 64-bit words from the start of | |
1616 | .BR u . | |
1617 | .TP | |
1618 | .B aformat | |
1619 | format of | |
1620 | .B a | |
1621 | data (1: local attribute data, 2: extent list, 3: Btree root). | |
1622 | .TP | |
1623 | .B dmevmask | |
1624 | DMAPI event mask. | |
1625 | .TP | |
1626 | .B dmstate | |
1627 | DMAPI state information. | |
1628 | .TP | |
1629 | .B newrtbm | |
1630 | file is the realtime bitmap and is "new" format. | |
1631 | .TP | |
1632 | .B prealloc | |
1633 | file has preallocated data space after EOF. | |
1634 | .TP | |
1635 | .B realtime | |
1636 | file data is in the realtime subvolume. | |
1637 | .TP | |
1638 | .B gen | |
1639 | inode generation number. | |
1640 | .RE | |
1641 | .IP | |
1642 | ||
1643 | The following fields are in the | |
1644 | .B u | |
1645 | data fork union: | |
1646 | .RS 1.4i | |
1647 | .TP 1.2i | |
1648 | .B bmbt | |
1649 | bmap Btree root. This looks like a | |
1650 | .B bmapbtd | |
1651 | block with redundant information removed. | |
1652 | .TP | |
1653 | .B bmx | |
1654 | array of extent descriptors. | |
1655 | .TP | |
1656 | .B dev | |
1657 | dev_t for the block or character device. | |
1658 | .TP | |
1659 | .B sfdir | |
1660 | shortform (in-inode) version 1 directory. This consists of a | |
1661 | .B hdr | |
1662 | containing the | |
1663 | .B parent | |
1664 | inode number and a | |
1665 | .B count | |
1666 | of active entries in the directory, followed by an array | |
1667 | .B list | |
1668 | of | |
1669 | .B hdr.count | |
1670 | entries. Each such entry contains | |
1671 | .BR inumber , | |
1672 | .BR namelen , | |
1673 | and | |
1674 | .B name | |
1675 | string. | |
1676 | .TP | |
1677 | .B sfdir2 | |
1678 | shortform (in-inode) version 2 directory. This consists of a | |
1679 | .B hdr | |
1680 | containing a | |
1681 | .B count | |
1682 | of active entries in the directory, an | |
1683 | .B i8count | |
1684 | of entries with inumbers that don't fit in a 32-bit value, and the | |
1685 | .B parent | |
1686 | inode number, followed by an array | |
1687 | .B list | |
1688 | of | |
1689 | .B hdr.count | |
1690 | entries. Each such entry contains | |
1691 | .BR namelen , | |
1692 | a saved | |
1693 | .B offset | |
1694 | used when the directory is converted to a larger form, a | |
1695 | .B name | |
1696 | string, and the | |
1697 | .BR inumber . | |
1698 | .TP | |
1699 | .B symlink | |
1700 | symbolic link string value. | |
1701 | .RE | |
1702 | .IP | |
1703 | ||
1704 | The following fields are in the | |
1705 | .B a | |
1706 | attribute fork union if it exists: | |
1707 | .RS 1.4i | |
1708 | .TP 1.2i | |
1709 | .B bmbt | |
1710 | bmap Btree root, as above. | |
1711 | .TP | |
1712 | .B bmx | |
1713 | array of extent descriptors. | |
1714 | .TP | |
1715 | .B sfattr | |
1716 | shortform (in-inode) attribute values. This consists of a | |
1717 | .B hdr | |
1718 | containing a | |
1719 | .B totsize | |
1720 | (total size in bytes) and a | |
1721 | .B count | |
1722 | of active entries, followed by an array | |
1723 | .B list | |
1724 | of | |
1725 | .B hdr.count | |
1726 | entries. Each such entry contains | |
1727 | .BR namelen , | |
1728 | .BR valuelen , | |
1729 | .BR root | |
1730 | flag, | |
1731 | .BR name , | |
1732 | and | |
1733 | .BR value . | |
1734 | .PD | |
1735 | .RE | |
1736 | .TP | |
1737 | .B log | |
1738 | Log blocks contain the journal entries for XFS. | |
1739 | It's not useful to examine these with | |
1740 | .BR xfs_db , | |
1741 | use | |
1742 | .BR xfs_logprint (8) | |
1743 | instead. | |
1744 | .TP | |
9fb2cb27 DW |
1745 | .B refcntbt |
1746 | There is one set of filesystem blocks forming the reference count Btree for | |
1747 | each allocation group. The root block of this Btree is designated by the | |
1748 | .B refcntroot | |
1749 | field in the corresponding AGF block. The blocks are linked to sibling left | |
1750 | and right blocks at each level, as well as by pointers from parent to child | |
1751 | blocks. Each block has the following fields: | |
1752 | .RS 1.4i | |
1753 | .PD 0 | |
1754 | .TP 1.2i | |
1755 | .B magic | |
1756 | REFC block magic number, 0x52334643 ('R3FC'). | |
1757 | .TP | |
1758 | .B level | |
1759 | level number of this block, 0 is a leaf. | |
1760 | .TP | |
1761 | .B numrecs | |
1762 | number of data entries in the block. | |
1763 | .TP | |
1764 | .B leftsib | |
1765 | left (logically lower) sibling block, 0 if none. | |
1766 | .TP | |
1767 | .B rightsib | |
1768 | right (logically higher) sibling block, 0 if none. | |
1769 | .TP | |
1770 | .B recs | |
1771 | [leaf blocks only] array of reference count records. Each record contains | |
1772 | .BR startblock , | |
1773 | .BR blockcount , | |
1774 | and | |
1775 | .BR refcount . | |
1776 | .TP | |
1777 | .B keys | |
1778 | [non-leaf blocks only] array of key records. These are the first value | |
1779 | of each block in the level below this one. Each record contains | |
1780 | .BR startblock . | |
1781 | .TP | |
1782 | .B ptrs | |
1783 | [non-leaf blocks only] array of child block pointers. Each pointer is a | |
1784 | block number within the allocation group to the next level in the Btree. | |
1785 | .PD | |
1786 | .RE | |
1787 | .TP | |
a9d7b986 DW |
1788 | .B rmapbt |
1789 | There is one set of filesystem blocks forming the reverse mapping Btree for | |
1790 | each allocation group. The root block of this Btree is designated by the | |
1791 | .B rmaproot | |
1792 | field in the corresponding AGF block. The blocks are linked to sibling left | |
1793 | and right blocks at each level, as well as by pointers from parent to child | |
1794 | blocks. Each block has the following fields: | |
1795 | .RS 1.4i | |
1796 | .PD 0 | |
1797 | .TP 1.2i | |
1798 | .B magic | |
1799 | RMAP block magic number, 0x524d4233 ('RMB3'). | |
1800 | .TP | |
1801 | .B level | |
1802 | level number of this block, 0 is a leaf. | |
1803 | .TP | |
1804 | .B numrecs | |
1805 | number of data entries in the block. | |
1806 | .TP | |
1807 | .B leftsib | |
1808 | left (logically lower) sibling block, 0 if none. | |
1809 | .TP | |
1810 | .B rightsib | |
1811 | right (logically higher) sibling block, 0 if none. | |
1812 | .TP | |
1813 | .B recs | |
1814 | [leaf blocks only] array of reference count records. Each record contains | |
1815 | .BR startblock , | |
1816 | .BR blockcount , | |
1817 | .BR owner , | |
1818 | .BR offset , | |
1819 | .BR attr_fork , | |
1820 | .BR bmbt_block , | |
1821 | and | |
1822 | .BR unwritten . | |
1823 | .TP | |
1824 | .B keys | |
1825 | [non-leaf blocks only] array of double-key records. The first ("low") key | |
1826 | contains the first value of each block in the level below this one. The second | |
1827 | ("high") key contains the largest key that can be used to identify any record | |
1828 | in the subtree. Each record contains | |
1829 | .BR startblock , | |
1830 | .BR owner , | |
1831 | .BR offset , | |
1832 | .BR attr_fork , | |
1833 | and | |
1834 | .BR bmbt_block . | |
1835 | .TP | |
1836 | .B ptrs | |
1837 | [non-leaf blocks only] array of child block pointers. Each pointer is a | |
1838 | block number within the allocation group to the next level in the Btree. | |
1839 | .PD | |
1840 | .RE | |
1841 | .TP | |
2017d0d0 BN |
1842 | .B rtbitmap |
1843 | If the filesystem has a realtime subvolume, then the | |
1844 | .B rbmino | |
1845 | field in the superblock refers to a file that contains the realtime bitmap. | |
2bd0ea18 | 1846 | Each bit in the bitmap file controls the allocation of a single realtime extent |
2017d0d0 BN |
1847 | (set == free). The bitmap is processed in 32-bit words, the LSB of a word is |
1848 | used for the first extent controlled by that bitmap word. The | |
1849 | .B atime | |
1850 | field of the realtime bitmap inode contains a counter | |
2bd0ea18 NS |
1851 | that is used to control where the next new realtime file will start. |
1852 | .TP | |
2017d0d0 BN |
1853 | .B rtsummary |
1854 | If the filesystem has a realtime subvolume, then the | |
1855 | .B rsumino | |
1856 | field in the superblock refers to a file that contains the realtime summary | |
1857 | data. The summary file contains a two-dimensional array of 16-bit values. | |
2bd0ea18 NS |
1858 | Each value counts the number of free extent runs |
1859 | (consecutive free realtime extents) | |
1860 | of a given range of sizes that starts in a given bitmap block. | |
1861 | The size ranges are binary buckets (low size in the bucket is a power of 2). | |
1862 | There are as many size ranges as are necessary given the size of the | |
1863 | realtime subvolume. | |
1864 | The first dimension is the size range, | |
1865 | the second dimension is the starting bitmap block number | |
1866 | (adjacent entries are for the same size, adjacent bitmap blocks). | |
1867 | .TP | |
2017d0d0 | 1868 | .B sb |
2bd0ea18 NS |
1869 | There is one sb (superblock) structure per allocation group. |
1870 | It is the first disk block in the allocation group. | |
1871 | Only the first one (block 0 of the filesystem) is actually used; | |
2017d0d0 BN |
1872 | the other blocks are redundant information for |
1873 | .BR xfs_repair (8) | |
1874 | to use if the first superblock is damaged. Fields defined: | |
1875 | .RS 1.4i | |
1876 | .PD 0 | |
1877 | .TP 1.2i | |
1878 | .B magicnum | |
1879 | superblock magic number, 0x58465342 ('XFSB'). | |
1880 | .TP | |
1881 | .B blocksize | |
1882 | filesystem block size in bytes. | |
1883 | .TP | |
1884 | .B dblocks | |
1885 | number of filesystem blocks present in the data subvolume. | |
1886 | .TP | |
1887 | .B rblocks | |
1888 | number of filesystem blocks present in the realtime subvolume. | |
1889 | .TP | |
1890 | .B rextents | |
1891 | number of realtime extents that | |
1892 | .B rblocks | |
1893 | contain. | |
1894 | .TP | |
1895 | .B uuid | |
1896 | unique identifier of the filesystem. | |
1897 | .TP | |
1898 | .B logstart | |
1899 | starting filesystem block number of the log (journal). | |
1900 | If this value is 0 the log is "external". | |
1901 | .TP | |
1902 | .B rootino | |
1903 | root inode number. | |
1904 | .TP | |
1905 | .B rbmino | |
1906 | realtime bitmap inode number. | |
1907 | .TP | |
1908 | .B rsumino | |
1909 | realtime summary data inode number. | |
1910 | .TP | |
1911 | .B rextsize | |
1912 | realtime extent size in filesystem blocks. | |
1913 | .TP | |
1914 | .B agblocks | |
1915 | size of an allocation group in filesystem blocks. | |
1916 | .TP | |
1917 | .B agcount | |
1918 | number of allocation groups. | |
1919 | .TP | |
1920 | .B rbmblocks | |
1921 | number of realtime bitmap blocks. | |
1922 | .TP | |
1923 | .B logblocks | |
1924 | number of log blocks (filesystem blocks). | |
1925 | .TP | |
1926 | .B versionnum | |
1927 | filesystem version information. | |
2bd0ea18 NS |
1928 | This value is currently 1, 2, 3, or 4 in the low 4 bits. |
1929 | If the low bits are 4 then the other bits have additional meanings. | |
1930 | 1 is the original value. | |
1931 | 2 means that attributes were used. | |
1932 | 3 means that version 2 inodes (large link counts) were used. | |
1933 | 4 is the bitmask version of the version number. | |
1934 | In this case, the other bits are used as flags | |
1935 | (0x0010: attributes were used, | |
1936 | 0x0020: version 2 inodes were used, | |
1937 | 0x0040: quotas were used, | |
1938 | 0x0080: inode cluster alignment is in force, | |
1939 | 0x0100: data stripe alignment is in force, | |
2017d0d0 BN |
1940 | 0x0200: the |
1941 | .B shared_vn | |
1942 | field is used, | |
2bd0ea18 | 1943 | 0x1000: unwritten extent tracking is on, |
2017d0d0 BN |
1944 | 0x2000: version 2 directories are in use). |
1945 | .TP | |
1946 | .B sectsize | |
1947 | sector size in bytes, currently always 512. | |
1948 | This is the size of the superblock and the other header blocks. | |
1949 | .TP | |
1950 | .B inodesize | |
1951 | inode size in bytes. | |
1952 | .TP | |
1953 | .B inopblock | |
1954 | number of inodes per filesystem block. | |
1955 | .TP | |
1956 | .B fname | |
1957 | obsolete, filesystem name. | |
1958 | .TP | |
1959 | .B fpack | |
1960 | obsolete, filesystem pack name. | |
1961 | .TP | |
1962 | .B blocklog | |
1963 | log2 of | |
1964 | .BR blocksize . | |
1965 | .TP | |
1966 | .B sectlog | |
1967 | log2 of | |
1968 | .BR sectsize . | |
1969 | .TP | |
1970 | .B inodelog | |
1971 | log2 of | |
1972 | .BR inodesize . | |
1973 | .TP | |
1974 | .B inopblog | |
1975 | log2 of | |
1976 | .BR inopblock . | |
1977 | .TP | |
1978 | .B agblklog | |
1979 | log2 of | |
1980 | .B agblocks | |
1981 | (rounded up). | |
1982 | .TP | |
1983 | .B rextslog | |
1984 | log2 of | |
1985 | .BR rextents . | |
1986 | .TP | |
1987 | .B inprogress | |
1988 | .BR mkfs.xfs (8) | |
1989 | or | |
1990 | .BR xfs_copy (8) | |
1991 | aborted before completing this filesystem. | |
1992 | .TP | |
1993 | .B imax_pct | |
1994 | maximum percentage of filesystem space used for inode blocks. | |
1995 | .TP | |
1996 | .B icount | |
1997 | number of allocated inodes. | |
1998 | .TP | |
1999 | .B ifree | |
2000 | number of allocated inodes that are not in use. | |
2001 | .TP | |
2002 | .B fdblocks | |
2003 | number of free data blocks. | |
2004 | .TP | |
2005 | .B frextents | |
2006 | number of free realtime extents. | |
2007 | .TP | |
2008 | .B uquotino | |
2009 | user quota inode number. | |
2010 | .TP | |
2011 | .B pquotino | |
2012 | project quota inode number; this is currently unused. | |
2013 | .TP | |
2014 | .B qflags | |
2015 | quota status flags | |
2bd0ea18 NS |
2016 | (0x01: user quota accounting is on, |
2017 | 0x02: user quota limits are enforced, | |
2018 | 0x04: quotacheck has been run on user quotas, | |
2019 | 0x08: project quota accounting is on, | |
2020 | 0x10: project quota limits are enforced, | |
2017d0d0 BN |
2021 | 0x20: quotacheck has been run on project quotas). |
2022 | .TP | |
2023 | .B flags | |
2024 | random flags. 0x01: only read-only mounts are allowed. | |
2025 | .TP | |
2026 | .B shared_vn | |
2027 | shared version number (shared readonly filesystems). | |
2028 | .TP | |
2029 | .B inoalignmt | |
2030 | inode chunk alignment in filesystem blocks. | |
2031 | .TP | |
2032 | .B unit | |
2033 | stripe or RAID unit. | |
2034 | .TP | |
2035 | .B width | |
2036 | stripe or RAID width. | |
2037 | .TP | |
2038 | .B dirblklog | |
2039 | log2 of directory block size (filesystem blocks). | |
2040 | .PD | |
2041 | .RE | |
2bd0ea18 | 2042 | .TP |
2017d0d0 | 2043 | .B symlink |
2bd0ea18 | 2044 | Symbolic link blocks are used only when the symbolic link value does |
2017d0d0 | 2045 | not fit inside the inode. The block content is just the string value. |
2bd0ea18 | 2046 | Bytes past the logical end of the symbolic link value have arbitrary values. |
c6b24b3b | 2047 | .TP |
2017d0d0 | 2048 | .B text |
c6b24b3b | 2049 | User file blocks, and other blocks whose type is unknown, |
2017d0d0 BN |
2050 | have this type for display purposes in |
2051 | .BR xfs_db . | |
d2df702b | 2052 | The block data is displayed in two columns: Hexadecimal format |
c6b24b3b | 2053 | and printable ASCII chars. |
2bd0ea18 | 2054 | .SH DIAGNOSTICS |
2017d0d0 BN |
2055 | Many messages can come from the |
2056 | .B check | |
2057 | .RB ( blockget ) | |
bfc541e7 ES |
2058 | command. |
2059 | If the filesystem is completely corrupt, a core dump might | |
2060 | be produced instead of the message | |
2061 | .RS | |
2062 | .I device | |
2063 | .B is not a valid filesystem | |
2064 | .RE | |
2065 | .PP | |
2066 | If the filesystem is very large (has many files) then | |
2067 | .B check | |
2068 | might run out of memory. In this case the message | |
2069 | .RS | |
2070 | .B out of memory | |
2071 | .RE | |
2072 | is printed. | |
2073 | .PP | |
2074 | The following is a description of the most likely problems and the associated | |
2075 | messages. | |
2076 | Most of the diagnostics produced are only meaningful with an understanding | |
2077 | of the structure of the filesystem. | |
2078 | .TP | |
2079 | .BI "agf_freeblks " n ", counted " m " in ag " a | |
2080 | The freeblocks count in the allocation group header for allocation group | |
2081 | .I a | |
2082 | doesn't match the number of blocks counted free. | |
2083 | .TP | |
2084 | .BI "agf_longest " n ", counted " m " in ag " a | |
2085 | The longest free extent in the allocation group header for allocation group | |
2086 | .I a | |
2087 | doesn't match the longest free extent found in the allocation group. | |
2088 | .TP | |
2089 | .BI "agi_count " n ", counted " m " in ag " a | |
2090 | The allocated inode count in the allocation group header for allocation group | |
2091 | .I a | |
2092 | doesn't match the number of inodes counted in the allocation group. | |
2093 | .TP | |
2094 | .BI "agi_freecount " n ", counted " m " in ag " a | |
2095 | The free inode count in the allocation group header for allocation group | |
2096 | .I a | |
2097 | doesn't match the number of inodes counted free in the allocation group. | |
2098 | .TP | |
2099 | .BI "block " a/b " expected inum 0 got " i | |
2100 | The block number is specified as a pair | |
2101 | (allocation group number, block in the allocation group). | |
2102 | The block is used multiple times (shared), between multiple inodes. | |
2103 | This message usually follows a message of the next type. | |
2104 | .TP | |
2105 | .BI "block " a/b " expected type unknown got " y | |
2106 | The block is used multiple times (shared). | |
2107 | .TP | |
2108 | .BI "block " a/b " type unknown not expected | |
2bd0ea18 | 2109 | .SH SEE ALSO |
2017d0d0 BN |
2110 | .BR mkfs.xfs (8), |
2111 | .BR xfs_admin (8), | |
2017d0d0 BN |
2112 | .BR xfs_copy (8), |
2113 | .BR xfs_logprint (8), | |
2114 | .BR xfs_metadump (8), | |
2115 | .BR xfs_ncheck (8), | |
2116 | .BR xfs_repair (8), | |
2117 | .BR mount (8), | |
2118 | .BR chmod (2), | |
2119 | .BR mknod (2), | |
2120 | .BR stat (2), | |
2121 | .BR xfs (5). |