1xfs_check(8) System Manager's Manual xfs_check(8)
2
3
4
6 xfs_check - check XFS filesystem consistency
7
9 xfs_check [ -i ino ] ... [ -b bno ] ... [ -f ] [ -s ] [ -v ] [ -l
10 logdev ] device
11
13 xfs_check checks whether an XFS filesystem is consistent. It is nor‐
14 mally run only when there is reason to believe that the filesystem has
15 a consistency problem. The filesystem to be checked is specified by
16 the device argument, which should be the disk or volume device for the
17 filesystem. Filesystems stored in files can also be checked, using the
18 -f flag. The filesystem should normally be unmounted or read-only dur‐
19 ing the execution of xfs_check. Otherwise, spurious problems are
20 reported.
21
23 -f Specifies that the filesystem image to be processed is stored in
24 a regular file at device (see the mkfs.xfs(8) -d file option).
25 This might happen if an image copy of a filesystem has been made
26 into an ordinary file.
27
28 -l logdev
29 Specifies the device where the filesystem's external log
30 resides. Only for those filesystems which use an external log.
31 See the mkfs.xfs(8) -l option, and refer to xfs(5) for a
32 detailed description of the XFS log.
33
34 -s Specifies that only serious errors should be reported. Serious
35 errors are those that make it impossible to find major data
36 structures in the filesystem. This option can be used to cut
37 down the amount of output when there is a serious problem, when
38 the output might make it difficult to see what the real problem
39 is.
40
41 -v Specifies verbose output; it is impossibly long for a reason‐
42 ably-sized filesystem. This option is intended for internal use
43 only.
44
45 -i ino Specifies verbose behavior for the specified inode ino. For
46 instance, it can be used to locate all the blocks associated
47 with a given inode.
48
49 -b bno Specifies verbose behavior for the specific filesystem block at
50 bno. For instance, it can be used to determine what a specific
51 block is used for. The block number is a "file system block num‐
52 ber". Conversion between disk addresses (i.e. addresses
53 reported by xfs_bmap(8)) and file system blocks may be accom‐
54 plished using xfs_db(8)'s convert command.
55
56 Any output that is produced when xfs_check is not run in verbose mode
57 indicates that the filesystem has an inconsistency. The filesystem can
58 be repaired using either xfs_repair(8) to fix the filesystem in place,
59 or by using xfsdump(8) and mkfs.xfs(8) to dump the filesystem, make a
60 new filesystem, then use xfsrestore(8) to restore the data onto the new
61 filesystem. Note that xfsdump may fail on a corrupt filesystem. How‐
62 ever, if the filesystem is mountable, xfsdump can be used to try and
63 save important data before repairing the filesystem with xfs_repair.
64 If the filesystem is not mountable though, xfs_repair is the only
65 viable option.
66
68 If the filesystem is completely corrupt, a core dump might be produced
69 instead of the message
70 device is not a valid filesystem
71
72 If the filesystem is very large (has many files) then xfs_check might
73 run out of memory. In this case the message
74 out of memory
75 is printed.
76
77 The following is a description of the most likely problems and the
78 associated messages. Most of the diagnostics produced are only mean‐
79 ingful with an understanding of the structure of the filesystem.
80
81 agf_freeblks n, counted m in ag a
82 The freeblocks count in the allocation group header for alloca‐
83 tion group a doesn't match the number of blocks counted free.
84
85 agf_longest n, counted m in ag a
86 The longest free extent in the allocation group header for allo‐
87 cation group a doesn't match the longest free extent found in
88 the allocation group.
89
90 agi_count n, counted m in ag a
91 The allocated inode count in the allocation group header for
92 allocation group a doesn't match the number of inodes counted in
93 the allocation group.
94
95 agi_freecount n, counted m in ag a
96 The free inode count in the allocation group header for alloca‐
97 tion group a doesn't match the number of inodes counted free in
98 the allocation group.
99
100 block a/b expected inum 0 got i
101 The block number is specified as a pair (allocation group num‐
102 ber, block in the allocation group). The block is used multiple
103 times (shared), between multiple inodes. This message usually
104 follows a message of the next type.
105
106 block a/b expected type unknown got y
107 The block is used multiple times (shared).
108
109 block a/b type unknown not expected
110 The block is unaccounted for (not in the freelist and not in
111 use).
112
113 link count mismatch for inode nnn (name xxx), nlink m, counted n
114 The inode has a bad link count (number of references in directo‐
115 ries).
116
117 rtblock b expected inum 0 got i
118 The block is used multiple times (shared), between multiple
119 inodes. This message usually follows a message of the next
120 type.
121
122 rtblock b expected type unknown got y
123 The real-time block is used multiple times (shared).
124
125 rtblock b type unknown not expected
126 The real-time block is unaccounted for (not in the freelist and
127 not in use).
128
129 sb_fdblocks n, counted m
130 The number of free data blocks recorded in the superblock
131 doesn't match the number counted free in the filesystem.
132
133 sb_frextents n, counted m
134 The number of free real-time extents recorded in the superblock
135 doesn't match the number counted free in the filesystem.
136
137 sb_icount n, counted m
138 The number of allocated inodes recorded in the superblock
139 doesn't match the number allocated in the filesystem.
140
141 sb_ifree n, counted m
142 The number of free inodes recorded in the superblock doesn't
143 match the number free in the filesystem.
144
146 mkfs.xfs(8), xfsdump(8), xfsrestore(8), xfs_ncheck(8), xfs_repair(8),
147 xfs(5).
148
149
150
151 xfs_check(8)