File: xfs_db.8

package info (click to toggle)
xfsprogs 2.9.8-1lenny1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,512 kB
  • ctags: 9,344
  • sloc: ansic: 92,865; makefile: 765; sh: 639
file content (1865 lines) | stat: -rw-r--r-- 43,435 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
.TH xfs_db 8
.SH NAME
xfs_db \- debug an XFS filesystem
.SH SYNOPSIS
.B xfs_db
[
.B \-c
.I cmd
] ... [
.BR \-i | r | x
] [
.B \-f
] [
.B \-l
.I logdev
] [
.B \-p
.I progname
]
.I device
.br
.B xfs_db \-V
.SH DESCRIPTION
.B xfs_db
is used to examine an XFS filesystem. Under rare circumstances it can also
be used to modify an XFS filesystem, but that task is normally left to
.BR xfs_repair (8)
or to scripts such as
.BR xfs_admin (8)
that run
.BR xfs_db .
.PP
.SH OPTIONS
.TP
.BI \-c " cmd"
.B xfs_db
commands may be run interactively (the default) or as arguments
on the command line. Multiple
.B \-c
arguments may be given. The commands are run in the sequence given,
then the program exits. This is the mechanism used to implement
.BR xfs_check (8).
.TP
.B \-f
Specifies that the filesystem image to be processed is stored in a
regular file at
.I device
(see the
.BR mkfs.xfs "(8) " -d
.I file
option).
This might happen if an image copy of a filesystem has been made into
an ordinary file with
.BR xfs_copy (8).
.TP
.B \-i
Allows execution on a mounted filesystem, provided it is mounted read-only.
Useful for shell scripts such as
.BR xfs_check (8),
which must only operate on filesystems in a guarenteed consistent state
(either unmounted or mounted read-only). These semantics are slightly
different to that of the
.B -r
option.
.TP
.BI \-l " logdev"
Specifies the device where the filesystems external log resides.
Only for those filesystems which use an external log. See the
.BR mkfs.xfs "(8) " \-l
option, and refer to
.BR xfs (5)
for a detailed description of the XFS log.
.TP
.BI \-p " progname"
Set the program name to
.I progname
for prompts and some error messages, the default value is
.BR xfs_db .
.TP
.B -r
Open
.I device
or
.I filename
read-only. This option is required if the filesystem is mounted.
It is only necessary to omit this flag if a command that changes data
.RB ( write ", " blocktrash )
is to be used.
.TP
.B \-x
Specifies expert mode.
This enables the
.B write
and
.B blocktrash
commands.
.TP
.B \-V
Prints out the current version number and exits.
.SH CONCEPTS
.B xfs_db
commands can be broken up into two classes. Most commands are for
the navigation and display of data structures in the filesystem.
Other commands are for scanning the filesystem in some way.
.PP
Commands which are used to navigate the filesystem structure take arguments
which reflect the names of filesystem structure fields.
There can be multiple field names separated by dots when the underlying
structures are nested, as in C.
The field names can be indexed (as an array index)
if the underlying field is an array.
The array indices can be specified as a range, two numbers separated by a dash.
.PP
.B xfs_db
maintains a current address in the filesystem.
The granularity of the address is a filesystem structure.
This can be a filesystem block,
an inode or quota (smaller than a filesystem block),
or a directory block (could be larger than a filesystem block).
There are a variety of commands to set the current address.
Associated with the current address is the current data type,
which is the structural type of this data.
Commands which follow the structure of the filesystem always set the type
as well as the address.
Commands which examine pieces of an individual file (inode) need the current
inode to be set, this is done with the
.B inode
command.
.PP
The current address/type information is actually maintained in a
stack that can be explicitly manipulated with the
.BR push ", " pop ", and " stack
commands.
This allows for easy examination of a nested filesystem structure.
Also, the last several locations visited are stored in a ring buffer
which can be manipulated with the
.BR forward ", " back ", and " ring
commands.
.PP
XFS filesystems are divided into a small number of allocation groups.
.B xfs_db
maintains a notion of the current allocation group which is
manipulated by some commands. The initial allocation group is 0.
.SH COMMANDS
.PP
Many commands have extensive online help. Use the
.B help
command for more details on any command.
.TP
.B a
See the
.B addr
command.
.TP
.BI ablock " filoff"
Set current address to the offset
.I filoff
(a filesystem block number) in the attribute area of the current inode.
.TP
.BI "addr [" field-expression ]
Set current address to the value of the
.IR field-expression .
This is used to "follow" a reference in one structure to the object
being referred to. If no argument is given, the current address is printed.
.TP
.BI "agf [" agno ]
Set current address to the AGF block for allocation group
.IR agno .
If no argument is given, use the current allocation group.
.TP
.BI "agfl [" agno ]
Set current address to the AGFL block for allocation group
.IR agno .
If no argument is given, use the current allocation group.
.TP
.BI "agi [" agno ]
Set current address to the AGI block for allocation group
.IR agno .
If no argument is given, use the current allocation group.
.TP
.B b
See the
.B back
command.
.TP
.B back
Move to the previous location in the position ring.
.TP
.B blockfree
Free block usage information collected by the last execution of the
.B blockget
command. This must be done before another
.B blockget
command can be given, presumably with different arguments than the previous one.
.TP
.BI "blockget [\-npvs] [\-b " bno "] ... [\-i " ino "] ..."
Get block usage and check filesystem consistency.
The information is saved for use by a subsequent
.BR blockuse ", " ncheck ", or " blocktrash
command. See
.BR xfs_check (8)
for more information.
.RS 1.0i
.TP 0.4i
.B \-b
is used to specify filesystem block numbers about which verbose
information should be printed.
.TP
.B \-i
is used to specify inode numbers about which verbose information
should be printed.
.TP
.B \-n
is used to save pathnames for inodes visited, this is used to support the
.BR xfs_ncheck (8)
command. It also means that pathnames will be printed for inodes that have
problems. This option uses a lot of memory so is not enabled by default.
.TP
.B \-p
causes error messages to be prefixed with the filesystem name being
processed. This is useful if several copies of
.B xfs_db
are run in parallel.
.TP
.B \-s
restricts output to severe errors only. This is useful if the output is
too long otherwise.
.TP
.B \-v
enables verbose output. Messages will be printed for every block and
inode processed.
.RE
.TP
.BI "blocktrash [\-n " count "] [\-x " min "] [\-y " max "] [\-s " seed "] [\-0|1|2|3] [\-t " type "] ..."
Trash randomly selected filesystem metadata blocks.
Trashing occurs to randomly selected bits in the chosen blocks.
This command is available only in debugging versions of
.BR xfs_db .
It is useful for testing
.BR xfs_repair "(8) and " xfs_check (8).
.RS 1.0i
.TP 0.4i
.BR \-0 " | " -1 " | " -2 " | " -3
These are used to set the operating mode for
.BR blocktrash .
Only one can be used:
.B \-0
changed bits are cleared;
.B \-1
changed bits are set;
.B -2
changed bits are inverted;
.B -3
changed bits are randomized.
.TP
.B \-n
supplies the
.I count
of block-trashings to perform (default 1).
.TP
.B \-s
supplies a
.I seed
to the random processing.
.TP
.B \-t
gives a
.I type
of blocks to be selected for trashing. Multiple
.B \-t
options may be given. If no
.B \-t
options are given then all metadata types can be trashed.
.TP
.B \-x
sets the
.I minimum
size of bit range to be trashed. The default value is 1.
.TP
.B \-y
sets the
.I maximum
size of bit range to be trashed. The default value is 1024.
.RE
.TP
.BI "blockuse [\-n] [\-c " count ]
Print usage for current filesystem block(s).
For each block, the type and (if any) inode are printed.
.RS 1.0i
.TP 0.4i
.B \-c
specifies a
.I count
of blocks to process. The default value is 1 (the current block only).
.TP
.B \-n
specifies that file names should be printed. The prior
.B blockget
command must have also specified the
.B \-n
option.
.RE
.TP
.BI "bmap [\-a\] [\-d] [" block " [" len ]]
Show the block map for the current inode.
The map display can be restricted to an area of the file with the
.I block
and
.I len
arguments. If
.I block
is given and
.I len
is omitted then 1 is assumed for len.
.IP
The
.B \-a
and
.B \-d
options are used to select the attribute or data
area of the inode, if neither option is given then both areas are shown.
.TP
.B check
See the
.B blockget
command.
.TP
.BI "convert " "type number" " [" "type number" "] ... " type
Convert from one address form to another.
The known
.IR type s,
with alternate names, are:
.RS 1.0i
.PD 0
.HP
.B agblock
or
.B agbno
(filesystem block within an allocation group)
.HP
.B agino
or
.B aginode
(inode number within an allocation group)
.HP
.B agnumber
or
.B agno
(allocation group number)
.HP
.B bboff
or
.B daddroff
(byte offset in a
.BR daddr )
.HP
.B blkoff
or
.B fsboff or
.B agboff
(byte offset in a
.B agblock
or
.BR fsblock )
.HP
.B byte
or
.B fsbyte
(byte address in filesystem)
.HP
.B daddr
or
.B bb
(disk address, 512-byte blocks)
.HP
.B fsblock
or
.B fsb
or
.B fsbno
(filesystem block, see the
.B fsblock
command)
.HP
.B ino
or
.B inode
(inode number)
.HP
.B inoidx
or
.B offset
(index of inode in filesystem block)
.HP
.B inooff
or
.B inodeoff
(byte offset in inode)
.PD
.RE
.IP
Only conversions that "make sense" are allowed.
The compound form (with more than three arguments) is useful for
conversions such as
.B convert agno
.I ag
.B agbno
.I agb
.BR fsblock .
.TP
.BI "daddr [" d ]
Set current address to the daddr (512 byte block) given by
.IR d .
If no value for
.I d
is given, the current address is printed, expressed as a daddr.
The type is set to
.B data
(uninterpreted).
.TP
.BI dblock " filoff"
Set current address to the offset
.I filoff
(a filesystem block number) in the data area of the current inode.
.TP
.BI "debug [" flagbits ]
Set debug option bits. These are used for debugging
.BR xfs_db .
If no value is given for
.IR flagbits ,
print the current debug option bits. These are for the use of the implementor.
.TP
.BI "dquot [" projectid_or_userid ]
Set current address to a project or user quota block.
.TP
.BI "echo [" arg "] ..."
Echo the arguments to the output.
.TP
.B f
See the
.B forward
command.
.TP
.B forward
Move forward to the next entry in the position ring.
.TP
.B frag [\-adflqRrv]
Get file fragmentation data. This prints information about fragmentation
of file data in the filesystem (as opposed to fragmentation of freespace,
for which see the
.B freesp
command). Every file in the filesystem is examined to see how far from ideal
its extent mappings are. A summary is printed giving the totals.
.RS 1.0i
.TP 0.4i
.B \-v
sets verbosity, every inode has information printed for it.
The remaining options select which inodes and extents are examined.
If no options are given then all are assumed set,
otherwise just those given are enabled.
.TP
.B \-a
enables processing of attribute data.
.TP
.B \-d
enables processing of directory data.
.TP
.B \-f
enables processing of regular file data.
.TP
.B \-l
enables processing of symbolic link data.
.TP
.B \-q
enables processing of quota file data.
.TP
.B \-R
enables processing of realtime control file data.
.TP
.B \-r
enables processing of realtime file data.
.RE
.TP
.BI "freesp [\-bcds] [\-a " ag "] ... [\-e " i "] [\-h " h1 "] ... [\-m " m ]
Summarize free space for the filesystem. The free blocks are examined
and totalled, and displayed in the form of a histogram, with a count
of extents in each range of free extent sizes.
.RS 1.0i
.TP 0.4i
.B \-a
adds
.I ag
to the list of allocation groups to be processed. If no
.B \-a
options are given then all allocation groups are processed.
.TP
.B \-b
specifies that the histogram buckets are binary-sized, with the starting
sizes being the powers of 2.
.TP
.B \-c
specifies that
.B freesp
will search the by-size (cnt) space Btree instead of the default
by-block (bno) space Btree.
.TP
.B \-d
specifies that every free extent will be displayed.
.TP
.B \-e
specifies that the histogram buckets are
equal-sized, with the size specified as
.IR i .
.TP
.B \-h
specifies a starting block number for a histogram bucket as
.IR h1 .
Multiple
.BR \-h 's
are given to specify the complete set of buckets.
.TP
.B \-m
specifies that the histogram starting block numbers are powers of
.IR m .
This is the general case of
.BR \-b .
.TP
.B \-s
specifies that a final summary of total free extents,
free blocks, and the average free extent size is printed.
.RE
.TP
.B fsb
See the
.B fsblock
command.
.TP
.BI "fsblock [" fsb ]
Set current address to the fsblock value given by
.IR fsb .
If no value for
.I fsb
is given the current address is printed, expressed as an fsb.
The type is set to
.B data
(uninterpreted). XFS filesystem block numbers are computed
.RI (( agno " << " agshift ") | " agblock )
where
.I agshift
depends on the size of an allocation group. Use the
.B convert
command to convert to and from this form. Block numbers given for file blocks
(for instance from the
.B bmap
command) are in this form.
.TP
.BI hash " string
Prints the hash value of
.I string
using the hash function of the XFS directory and attribute implementation.
.TP
.BI "help [" command ]
Print help for one or all commands.
.TP
.BI "inode [" inode# ]
Set the current inode number. If no
.I inode#
is given, print the current inode number.
.TP
.BI "label [" label ]
Set the filesystem label. The filesystem label can be used by
.BR mount (8)
instead of using a device special file.
The maximum length of an XFS label is 12 characters \- use of a longer
.I label
will result in truncation and a warning will be issued. If no
.I label
is given, the current filesystem label is printed.
.TP
.BI "log [stop | start " filename ]
Start logging output to
.IR filename ,
stop logging, or print the current logging status.
.TP
.BI "metadump [\-egow] " filename
Dumps metadata to a file. See
.BR xfs_metadump (8)
for more information.
.TP
.BI "ncheck [\-s] [\-i " ino "] ..."
Print name-inode pairs. A
.B blockget \-n
command must be run first to gather the information.
.RS 1.0i
.TP 0.4i
.B \-i
specifies an inode number to be printed. If no
.B \-i
options are given then all inodes are printed.
.TP
.B \-s
specifies that only setuid and setgid files are printed.
.RE
.TP
.B p
See the
.B print
command.
.TP
.B pop
Pop location from the stack.
.TP
.BI "print [" field-expression "] ..."
Print field values.
If no argument is given, print all fields in the current structure.
.TP
.BI "push [" command ]
Push location to the stack. If
.I command
is supplied, set the current location to the results of
.I command
after pushing the old location.
.TP
.B q
See the
.B quit
command.
.TP
.B quit
Exit
.BR xfs_db .
.TP
.BI "ring [" index ]
Show position ring (if no
.I index
argument is given), or move to a specific entry in the position ring given by
.IR index .
.TP
.BI "sb [" agno ]
Set current address to SB header in allocation group
.IR agno .
If no
.I agno
is given, use the current allocation group number.
.TP
.BI "source " source-file
Process commands from
.IR source-file .
.B source
commands can be nested.
.TP
.B stack
View the location stack.
.TP
.BI "type [" type ]
Set the current data type to
.IR type .
If no argument is given, show the current data type.
The possible data types are:
.BR agf ", " agfl ", " agi ", " attr ", " bmapbta ", " bmapbtd ,
.BR bnobt ", " cntbt ", " data ", " dir ", " dir2 ", " dqblk ,
.BR inobt ", " inode ", " log ", " rtbitmap ", " rtsummary ,
.BR sb ", " symlink " and " text .
See the TYPES section below for more information on these data types.
.TP
.BI "uuid [" uuid " | " generate " | " rewrite ]
Set the filesystem universally unique identifier (UUID).
The filesystem UUID can be used by
.BR mount (8)
instead of using a device special file.
The
.I uuid
can be set directly to the desired UUID, or it can
be automatically generated using the
.B generate
option. These options will both write the UUID into every copy of the
superblock in the filesystem.
.B rewrite
copies the current UUID from the primary superblock
to all secondary copies of the superblock.
If no argument is given, the current filesystem UUID is printed.
.TP
.BI "version [" feature " | " "versionnum features2" ]
Enable selected features for a filesystem (certain features can
be enabled on an unmounted filesystem, after
.BR mkfs.xfs (8)
has created the filesystem).
Support for unwritten extents can be enabled using the
.B extflg
option. Support for version 2 log format can be enabled using the
.B log2
option. Support for extended attributes can be enabled using the
.B attr1
or
.B attr2
option. Once enabled, extended attributes cannot be disabled, but the user
may toggle between
.B attr1
and
.B attr2
at will (older kernels may not support the newer version).
.IP
If no argument is given, the current version and feature bits are printed.
With one argument, this command will write the updated version number
into every copy of the superblock in the filesystem.
If two arguments are given, they will be used as numeric values for the
.I versionnum
and
.I features2
bits respectively, and their string equivalent reported
(but no modifications are made).
.TP
.BI "write [" "field value" "] ..."
Write a value to disk.
Specific fields can be set in structures (struct mode),
or a block can be set to data values (data mode),
or a block can be set to string values (string mode, for symlink blocks).
The operation happens immediately: there is no buffering.
.IP
Struct mode is in effect when the current type is structural,
i.e. not data. For struct mode, the syntax is "\c
.B write
.I field value\c
".
.IP
Data mode is in effect when the current type is data. In this case the
contents of the block can be shifted or rotated left or right, or filled
with a sequence, a constant value, or a random value. In this mode
.B write
with no arguments gives more information on the allowed commands.
.SH TYPES
This section gives the fields in each structure type and their meanings.
Note that some types of block cover multiple actual structures,
for instance directory blocks.
.TP 1.0i
.B agf
The AGF block is the header for block allocation information;
it is in the second 512-byte block of each allocation group.
The following fields are defined:
.RS 1.4i
.PD 0
.TP 1.2i
.B magicnum
AGF block magic number, 0x58414746 ('XAGF').
.TP
.B versionnum
version number, currently 1.
.TP
.B seqno
sequence number starting from 0.
.TP
.B length
size in filesystem blocks of the allocation group. All allocation
groups except the last one of the filesystem have the superblock's
.B agblocks
value here.
.TP
.B bnoroot
block number of the root of the Btree holding free space
information sorted by block number.
.TP
.B cntroot
block number of the root of the Btree holding free space
information sorted by block count.
.TP
.B bnolevel
number of levels in the by-block-number Btree.
.TP
.B cntlevel
number of levels in the by-block-count Btree.
.TP
.B flfirst
index into the AGFL block of the first active entry.
.TP
.B fllast
index into the AGFL block of the last active entry.
.TP
.B flcount
count of active entries in the AGFL block.
.TP
.B freeblks
count of blocks represented in the freespace Btrees.
.TP
.B longest
longest free space represented in the freespace Btrees.
.TP
.B btreeblks
number of blocks held in the AGF Btrees.
.PD
.RE
.TP
.B agfl
The AGFL block contains block numbers for use of the block allocator;
it is in the fourth 512-byte block of each allocation group.
Each entry in the active list is a block number within the allocation group
that can be used for any purpose if space runs low.
The AGF block fields
.BR flfirst ", " fllast ", and " flcount
designate which entries are currently active.
Entry space is allocated in a circular manner within the AGFL block.
Fields defined:
.RS 1.4i
.PD 0
.TP 1.2i
.B bno
array of all block numbers. Even those which are not active are printed.
.PD
.RE
.TP
.B agi
The AGI block is the header for inode allocation information;
it is in the third 512-byte block of each allocation group.
Fields defined:
.RS 1.4i
.PD 0
.TP 1.2i
.B magicnum
AGI block magic number, 0x58414749 ('XAGI').
.TP
.B versionnum
version number, currently 1.
.TP
.B seqno
sequence number starting from 0.
.TP
.B length
size in filesystem blocks of the allocation group.
.TP
.B count
count of inodes allocated.
.TP
.B root
block number of the root of the Btree holding inode allocation information.
.TP
.B level
number of levels in the inode allocation Btree.
.TP
.B freecount
count of allocated inodes that are not in use.
.TP
.B newino
last inode number allocated.
.TP
.B dirino
unused.
.TP
.B unlinked
an array of inode numbers within the allocation group. The entries
in the AGI block are the heads of lists which run through the inode
.B next_unlinked
field. These inodes are to be unlinked the next time the filesystem is mounted.
.PD
.RE
.TP
.B attr
An attribute fork is organized as a Btree with the actual data embedded
in the leaf blocks. The root of the Btree is found in block 0 of the fork.
The index (sort order) of the Btree is the hash value of the attribute name.
All the blocks contain a
.B blkinfo
structure at the beginning, see type
.B dir
for a description. Nonleaf blocks are identical in format to those for
version 1 and version 2 directories, see type
.B dir
for a description. Leaf blocks can refer to "local" or "remote" attribute
values. Local values are stored directly in the leaf block.
Remote values are stored in an independent block in the attribute fork
(with no structure). Leaf blocks contain the following fields:
.RS 1.4i
.PD 0
.TP 1.2i
.B hdr
header containing a
.B blkinfo
structure
.B info
(magic number 0xfbee), a
.B count
of active entries,
.B usedbytes
total bytes of names and values, the
.B firstused
byte in the name area,
.B holes
set if the block needs compaction, and array
.B freemap
as for
.B dir
leaf blocks.
.TP
.B entries
array of structures containing a
.BR hashval ,
.B nameidx
(index into the block of the name), and flags
.BR incomplete ,
.BR root ,
and
.BR local .
.TP
.B nvlist
array of structures describing the attribute names and values. Fields
always present:
.B valuelen
(length of value in bytes),
.BR namelen ,
and
.BR name .
Fields present for local values:
.B value
(value string). Fields present for remote values:
.B valueblk
(fork block number of containing the value).
.PD
.RE
.TP
.B bmapbt
Files with many extents in their data or attribute fork will have the
extents described by the contents of a Btree for that fork,
instead of being stored directly in the inode.
Each bmap Btree starts with a root block contained within the inode.
The other levels of the Btree are stored in filesystem blocks.
The blocks are linked to sibling left and right blocks at each level,
as well as by pointers from parent to child blocks.
Each block contains the following fields:
.RS 1.4i
.PD 0
.TP 1.2i
.B magic
bmap Btree block magic number, 0x424d4150 ('BMAP').
.TP
.B level
level of this block above the leaf level.
.TP
.B numrecs
number of records or keys in the block.
.TP
.B leftsib
left (logically lower) sibling block, 0 if none.
.TP
.B rightsib
right (logically higher) sibling block, 0 if none.
.TP
.B recs
[leaf blocks only] array of extent records.
Each record contains
.BR startoff ,
.BR startblock ,
.BR blockcount ,
and
.B extentflag
(1 if the extent is unwritten).
.TP
.B keys
[nonleaf blocks only] array of key records. These are the first key
value of each block in the level below this one. Each record contains
.BR startoff .
.TP
.B ptrs
[nonleaf blocks only] array of child block pointers.
Each pointer is a filesystem block number to the next level in the Btree.
.PD
.RE
.TP
.B bnobt
There is one set of filesystem blocks forming the by-block-number
allocation Btree for each allocation group. The root block of this
Btree is designated by the
.B bnoroot
field in the coresponding AGF block.
The blocks are linked to sibling left and right blocks at each level,
as well as by pointers from parent to child blocks.
Each block has the following fields:
.RS 1.4i
.PD 0
.TP 1.2i
.B magic
BNOBT block magic number, 0x41425442 ('ABTB').
.TP
.B level
level number of this block, 0 is a leaf.
.TP
.B numrecs
number of data entries in the block.
.TP
.B leftsib
left (logically lower) sibling block, 0 if none.
.TP
.B rightsib
right (logically higher) sibling block, 0 if none.
.TP
.B recs
[leaf blocks only] array of freespace records. Each record contains
.B startblock
and
.BR blockcount .
.TP
.B keys
[nonleaf blocks only] array of key records. These are the first value
of each block in the level below this one. Each record contains
.B startblock
and
.BR blockcount .
.TP
.B ptrs
[nonleaf blocks only] array of child block pointers. Each pointer is a
block number within the allocation group to the next level in the Btree.
.PD
.RE
.TP
.B cntbt
There is one set of filesystem blocks forming the by-block-count
allocation Btree for each allocation group. The root block of this
Btree is designated by the
.B cntroot
field in the coresponding AGF block. The blocks are linked to sibling
left and right blocks at each level, as well as by pointers from parent
to child blocks. Each block has the following fields:
.RS 1.4i
.PD 0
.TP 1.2i
.B magic
CNTBT block magic number, 0x41425443 ('ABTC').
.TP
.B level
level number of this block, 0 is a leaf.
.TP
.B numrecs
number of data entries in the block.
.TP
.B leftsib
left (logically lower) sibling block, 0 if none.
.TP
.B rightsib
right (logically higher) sibling block, 0 if none.
.TP
.B recs
[leaf blocks only] array of freespace records. Each record contains
.B startblock
and
.BR blockcount .
.TP
.B keys
[nonleaf blocks only] array of key records. These are the first value
of each block in the level below this one. Each record contains
.B blockcount
and
.BR startblock .
.TP
.B ptrs
[nonleaf blocks only] array of child block pointers. Each pointer is a
block number within the allocation group to the next level in the Btree.
.PD
.RE
.TP
.B data
User file blocks, and other blocks whose type is unknown, have this
type for display purposes in
.BR xfs_db .
The block data is displayed in hexadecimal format.
.TP
.B dir
A version 1 directory is organized as a Btree with the directory data
embedded in the leaf blocks. The root of the Btree is found in block 0
of the file. The index (sort order) of the Btree is the hash value of
the entry name. All the blocks contain a
.B blkinfo
structure at the beginning with the following fields:
.RS 1.4i
.PD 0
.TP 1.2i
.B forw
next sibling block.
.TP
.B back
previous sibling block.
.TP
.B magic
magic number for this block type.
.RE
.IP

The non-leaf (node) blocks have the following fields:
.RS 1.4i
.TP 1.2i
.B hdr
header containing a
.B blkinfo
structure
.B info
(magic number 0xfebe), the
.B count
of active entries, and the
.B level
of this block above the leaves.
.TP
.B btree
array of entries containing
.B hashval
and
.B before
fields. The
.B before
value is a block number within the directory file to the child block, the
.B hashval
is the last hash value in that block.
.RE
.IP

The leaf blocks have the following fields:
.RS 1.4i
.TP 1.2i
.B hdr
header containing a
.B blkinfo
structure
.B info
(magic number 0xfeeb), the
.B count
of active entries,
.B namebytes
(total name string bytes),
.B holes
flag (block needs compaction), and
.B freemap
(array of
.BR base ", " size
entries for free regions).
.TP
.B entries
array of structures containing
.BR hashval ,
.B nameidx
(byte index into the block of the name string), and
.BR namelen .
.TP
.B namelist
array of structures containing
.B inumber
and
.BR name .
.RE
.PD
.TP
.B dir2
A version 2 directory has four kinds of blocks.
Data blocks start at offset 0 in the file.
There are two kinds of data blocks: single-block directories have
the leaf information embedded at the end of the block, data blocks
in multi-block directories do not.
Node and leaf blocks start at offset 32GiB (with either a single
leaf block or the root node block).
Freespace blocks start at offset 64GiB.
The node and leaf blocks form a Btree, with references to the data
in the data blocks.
The freespace blocks form an index of longest free spaces within the
data blocks.
.IP
A single-block directory block contains the following fields:
.RS 1.4i
.PD 0
.TP 1.2i
.B bhdr
header containing
.B magic
number 0x58443242 ('XD2B') and an array
.B bestfree
of the longest 3 free spaces in the block
.RB ( offset ", " length ).
.TP
.B bu
array of union structures. Each element is either an entry or a freespace.
For entries, there are the following fields:
.BR inumber ,
.BR namelen ,
.BR name ,
and
.BR tag .
For freespace, there are the following fields:
.B freetag
(0xffff),
.BR length ,
and
.BR tag .
The
.B tag
value is the byte offset in the block of the start of the entry it
is contained in.
.TP
.B bleaf
array of leaf entries containing
.B hashval
and
.BR address .
The
.B address
is a 64-bit word offset into the file.
.TP
.B btail
tail structure containing the total
.B count
of leaf entries and
.B stale
count of unused leaf entries.
.RE
.IP

A data block contains the following fields:
.RS 1.4i
.TP 1.2i
.B dhdr
header containing
.B magic
number 0x58443244 ('XD2D') and an array
.B bestfree
of the longest 3 free spaces in the block
.RB ( offset ", " length ).
.TP
.B du
array of union structures as for
.BR bu .
.RE
.IP

Leaf blocks have two possible forms. If the Btree consists of a single
leaf then the freespace information is in the leaf block,
otherwise it is in separate blocks and the root of the Btree is
a node block. A leaf block contains the following fields:
.RS 1.4i
.TP 1.2i
.B lhdr
header containing a
.B blkinfo
structure
.B info
(magic number 0xd2f1 for the single leaf case, 0xd2ff for the true
Btree case), the total
.B count
of leaf entries, and
.B stale
count of unused leaf entries.
.TP
.B lents
leaf entries, as for
.BR bleaf .
.TP
.B lbests
[single leaf only] array of values which represent the longest freespace
in each data block in the directory.
.TP
.B ltail
[single leaf only] tail structure containing
.B bestcount
count of
.BR lbests .
.RE
.IP

A node block is identical to that for types
.B attr
and
.BR dir .

A freespace block contains the following fields:
.RS 1.4i
.TP 1.2i
.B fhdr
header containing
.B magic
number 0x58443246 ('XD2F'),
.B firstdb
first data block number covered by this freespace block,
.B nvalid
number of valid entries, and
.B nused
number of entries representing real data blocks.
.TP
.B fbests
array of values as for
.BR lbests .
.PD
.RE
.TP
.B dqblk
The quota information is stored in files referred to by the superblock
.B uquotino
and
.B pquotino
fields. Each filesystem block in a quota file contains a constant number of
quota entries. The quota entry size is currently 136 bytes, so with a 4KiB
filesystem block size there are 30 quota entries per block. The
.B dquot
command is used to locate these entries in the filesystem.
The file entries are indexed by the user or project identifier
to determine the block and offset.
Each quota entry has the following fields:
.RS 1.4i
.PD 0
.TP 1.5i
.B magic
magic number, 0x4451 ('DQ').
.TP
.B version
version number, currently 1.
.TP
.B flags
flags, values include 0x01 for user quota, 0x02 for project quota.
.TP
.B id
user or project identifier.
.TP
.B blk_hardlimit
absolute limit on blocks in use.
.TP
.B blk_softlimit
preferred limit on blocks in use.
.TP
.B ino_hardlimit
absolute limit on inodes in use.
.TP
.B ino_softlimit
preferred limit on inodes in use.
.TP
.B bcount
blocks actually in use.
.TP
.B icount
inodes actually in use.
.TP
.B itimer
time when service will be refused if soft limit is violated for inodes.
.TP
.B btimer
time when service will be refused if soft limit is violated for blocks.
.TP
.B iwarns
number of warnings issued about inode limit violations.
.TP
.B bwarns
number of warnings issued about block limit violations.
.TP
.B rtb_hardlimit
absolute limit on realtime blocks in use.
.TP
.B rtb_softlimit
preferred limit on realtime blocks in use.
.TP
.B rtbcount
realtime blocks actually in use.
.TP
.B rtbtimer
time when service will be refused if soft limit is violated for realtime blocks.
.TP
.B rtbwarns
number of warnings issued about realtime block limit violations.
.PD
.RE
.TP
.B inobt
There is one set of filesystem blocks forming the inode allocation Btree for
each allocation group. The root block of this Btree is designated by the
.B root
field in the coresponding AGI block.
The blocks are linked to sibling left and right blocks at each level,
as well as by pointers from parent to child blocks.
Each block has the following fields:
.RS 1.4i
.PD 0
.TP 1.2i
.B magic
INOBT block magic number, 0x49414254 ('IABT').
.TP
.B level
level number of this block, 0 is a leaf.
.TP
.B numrecs
number of data entries in the block.
.TP
.B leftsib
left (logically lower) sibling block, 0 if none.
.TP
.B rightsib
right (logically higher) sibling block, 0 if none.
.TP
.B recs
[leaf blocks only] array of inode records. Each record contains
.B startino
allocation-group relative inode number,
.B freecount
count of free inodes in this chunk, and
.B free
bitmap, LSB corresponds to inode 0.
.TP
.B keys
[nonleaf blocks only] array of key records. These are the first value of each
block in the level below this one. Each record contains
.BR startino .
.TP
.B ptrs
[nonleaf blocks only] array of child block pointers. Each pointer is a
block number within the allocation group to the next level in the Btree.
.PD
.RE
.TP
.B inode
Inodes are allocated in "chunks" of 64 inodes each. Usually a chunk is
multiple filesystem blocks, although there are cases with large filesystem
blocks where a chunk is less than one block. The inode Btree (see
.B inobt
above) refers to the inode numbers per allocation group. The inode numbers
directly reflect the location of the inode block on disk. Use the
.B inode
command to point
.B xfs_db
to a specific inode. Each inode contains four regions:
.BR core ,
.BR next_unlinked ,
.BR u ", and "
.BR a .
.B core
contains the fixed information.
.B next_unlinked
is separated from the core due to journaling considerations, see type
.B agi
field
.BR unlinked .
.B u
is a union structure that is different in size and format depending
on the type and representation of the file data ("data fork").
.B a
is an optional union structure to describe attribute data,
that is different in size, format, and location depending on the presence
and representation of attribute data, and the size of the
.B u
data ("attribute fork").
.B xfs_db
automatically selects the proper union members based on information
in the inode.
.IP
The following are fields in the inode core:
.RS 1.4i
.PD 0
.TP 1.2i
.B magic
inode magic number, 0x494e ('IN').
.TP
.B mode
mode and type of file, as described in
.BR chmod (2),
.BR mknod (2),
and
.BR stat (2).
.TP
.B version
inode version, 1 or 2.
.TP
.B format
format of
.B u
union data (0: xfs_dev_t, 1: local file \- in-inode directory or symlink,
2: extent list, 3: Btree root, 4: unique id [unused]).
.TP
.B nlinkv1
number of links to the file in a version 1 inode.
.TP
.B nlinkv2
number of links to the file in a version 2 inode.
.TP
.B projid
owner's project id (version 2 inode only).
.TP
.B uid
owner's user id.
.TP
.B gid
owner's group id.
.TP
.B atime
time last accessed (seconds and nanoseconds).
.TP
.B mtime
time last modified.
.TP
.B ctime
time created or inode last modified.
.TP
.B size
number of bytes in the file.
.TP
.B nblocks
total number of blocks in the file including indirect and attribute.
.TP
.B extsize
basic/minimum extent size for the file.
.TP
.B nextents
number of extents in the data fork.
.TP
.B naextents
number of extents in the attribute fork.
.TP
.B forkoff
attribute fork offset in the inode, in 64-bit words from the start of
.BR u .
.TP
.B aformat
format of
.B a
data (1: local attribute data, 2: extent list, 3: Btree root).
.TP
.B dmevmask
DMAPI event mask.
.TP
.B dmstate
DMAPI state information.
.TP
.B newrtbm
file is the realtime bitmap and is "new" format.
.TP
.B prealloc
file has preallocated data space after EOF.
.TP
.B realtime
file data is in the realtime subvolume.
.TP
.B gen
inode generation number.
.RE
.IP

The following fields are in the
.B u
data fork union:
.RS 1.4i
.TP 1.2i
.B bmbt
bmap Btree root. This looks like a
.B bmapbtd
block with redundant information removed.
.TP
.B bmx
array of extent descriptors.
.TP
.B dev
dev_t for the block or character device.
.TP
.B sfdir
shortform (in-inode) version 1 directory. This consists of a
.B hdr
containing the
.B parent
inode number and a
.B count
of active entries in the directory, followed by an array
.B list
of
.B hdr.count
entries. Each such entry contains
.BR inumber ,
.BR namelen ,
and
.B name
string.
.TP
.B sfdir2
shortform (in-inode) version 2 directory. This consists of a
.B hdr
containing a
.B count
of active entries in the directory, an
.B i8count
of entries with inumbers that don't fit in a 32-bit value, and the
.B parent
inode number, followed by an array
.B list
of
.B hdr.count
entries. Each such entry contains
.BR namelen ,
a saved
.B offset
used when the directory is converted to a larger form, a
.B name
string, and the
.BR inumber .
.TP
.B symlink
symbolic link string value.
.RE
.IP

The following fields are in the
.B a
attribute fork union if it exists:
.RS 1.4i
.TP 1.2i
.B bmbt
bmap Btree root, as above.
.TP
.B bmx
array of extent descriptors.
.TP
.B sfattr
shortform (in-inode) attribute values. This consists of a
.B hdr
containing a
.B totsize
(total size in bytes) and a
.B count
of active entries, followed by an array
.B list
of
.B hdr.count
entries. Each such entry contains
.BR namelen ,
.BR valuelen ,
.BR root
flag,
.BR name ,
and
.BR value .
.PD
.RE
.TP
.B log
Log blocks contain the journal entries for XFS.
It's not useful to examine these with
.BR xfs_db ,
use
.BR xfs_logprint (8)
instead.
.TP
.B rtbitmap
If the filesystem has a realtime subvolume, then the
.B rbmino
field in the superblock refers to a file that contains the realtime bitmap.
Each bit in the bitmap file controls the allocation of a single realtime extent
(set == free). The bitmap is processed in 32-bit words, the LSB of a word is
used for the first extent controlled by that bitmap word. The
.B atime
field of the realtime bitmap inode contains a counter
that is used to control where the next new realtime file will start.
.TP
.B rtsummary
If the filesystem has a realtime subvolume, then the
.B rsumino
field in the superblock refers to a file that contains the realtime summary
data. The summary file contains a two-dimensional array of 16-bit values.
Each value counts the number of free extent runs
(consecutive free realtime extents)
of a given range of sizes that starts in a given bitmap block.
The size ranges are binary buckets (low size in the bucket is a power of 2).
There are as many size ranges as are necessary given the size of the
realtime subvolume.
The first dimension is the size range,
the second dimension is the starting bitmap block number
(adjacent entries are for the same size, adjacent bitmap blocks).
.TP
.B sb
There is one sb (superblock) structure per allocation group.
It is the first disk block in the allocation group.
Only the first one (block 0 of the filesystem) is actually used;
the other blocks are redundant information for
.BR xfs_repair (8)
to use if the first superblock is damaged. Fields defined:
.RS 1.4i
.PD 0
.TP 1.2i
.B magicnum
superblock magic number, 0x58465342 ('XFSB').
.TP
.B blocksize
filesystem block size in bytes.
.TP
.B dblocks
number of filesystem blocks present in the data subvolume.
.TP
.B rblocks
number of filesystem blocks present in the realtime subvolume.
.TP
.B rextents
number of realtime extents that
.B rblocks
contain.
.TP
.B uuid
unique identifier of the filesystem.
.TP
.B logstart
starting filesystem block number of the log (journal).
If this value is 0 the log is "external".
.TP
.B rootino
root inode number.
.TP
.B rbmino
realtime bitmap inode number.
.TP
.B rsumino
realtime summary data inode number.
.TP
.B rextsize
realtime extent size in filesystem blocks.
.TP
.B agblocks
size of an allocation group in filesystem blocks.
.TP
.B agcount
number of allocation groups.
.TP
.B rbmblocks
number of realtime bitmap blocks.
.TP
.B logblocks
number of log blocks (filesystem blocks).
.TP
.B versionnum
filesystem version information.
This value is currently 1, 2, 3, or 4 in the low 4 bits.
If the low bits are 4 then the other bits have additional meanings.
1 is the original value.
2 means that attributes were used.
3 means that version 2 inodes (large link counts) were used.
4 is the bitmask version of the version number.
In this case, the other bits are used as flags
(0x0010: attributes were used,
0x0020: version 2 inodes were used,
0x0040: quotas were used,
0x0080: inode cluster alignment is in force,
0x0100: data stripe alignment is in force,
0x0200: the
.B shared_vn
field is used,
0x1000: unwritten extent tracking is on,
0x2000: version 2 directories are in use).
.TP
.B sectsize
sector size in bytes, currently always 512.
This is the size of the superblock and the other header blocks.
.TP
.B inodesize
inode size in bytes.
.TP
.B inopblock
number of inodes per filesystem block.
.TP
.B fname
obsolete, filesystem name.
.TP
.B fpack
obsolete, filesystem pack name.
.TP
.B blocklog
log2 of
.BR blocksize .
.TP
.B sectlog
log2 of
.BR sectsize .
.TP
.B inodelog
log2 of
.BR inodesize .
.TP
.B inopblog
log2 of
.BR inopblock .
.TP
.B agblklog
log2 of
.B agblocks
(rounded up).
.TP
.B rextslog
log2 of
.BR rextents .
.TP
.B inprogress
.BR mkfs.xfs (8)
or
.BR xfs_copy (8)
aborted before completing this filesystem.
.TP
.B imax_pct
maximum percentage of filesystem space used for inode blocks.
.TP
.B icount
number of allocated inodes.
.TP
.B ifree
number of allocated inodes that are not in use.
.TP
.B fdblocks
number of free data blocks.
.TP
.B frextents
number of free realtime extents.
.TP
.B uquotino
user quota inode number.
.TP
.B pquotino
project quota inode number; this is currently unused.
.TP
.B qflags
quota status flags
(0x01: user quota accounting is on,
0x02: user quota limits are enforced,
0x04: quotacheck has been run on user quotas,
0x08: project quota accounting is on,
0x10: project quota limits are enforced,
0x20: quotacheck has been run on project quotas).
.TP
.B flags
random flags. 0x01: only read-only mounts are allowed.
.TP
.B shared_vn
shared version number (shared readonly filesystems).
.TP
.B inoalignmt
inode chunk alignment in filesystem blocks.
.TP
.B unit
stripe or RAID unit.
.TP
.B width
stripe or RAID width.
.TP
.B dirblklog
log2 of directory block size (filesystem blocks).
.PD
.RE
.TP
.B symlink
Symbolic link blocks are used only when the symbolic link value does
not fit inside the inode. The block content is just the string value.
Bytes past the logical end of the symbolic link value have arbitrary values.
.TP
.B text
User file blocks, and other blocks whose type is unknown,
have this type for display purposes in
.BR xfs_db .
The block data is displayed in two columns: Hexadecimal format
and printable ASCII chars.
.SH DIAGNOSTICS
Many messages can come from the
.B check
.RB ( blockget )
command; these are documented in
.BR xfs_check (8).
.SH SEE ALSO
.BR mkfs.xfs (8),
.BR xfs_admin (8),
.BR xfs_check (8),
.BR xfs_copy (8),
.BR xfs_logprint (8),
.BR xfs_metadump (8),
.BR xfs_ncheck (8),
.BR xfs_repair (8),
.BR mount (8),
.BR chmod (2),
.BR mknod (2),
.BR stat (2),
.BR xfs (5).