File: xfs_check.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 (192 lines) | stat: -rw-r--r-- 5,995 bytes parent folder | download | duplicates (3)
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
.TH xfs_check 8
.SH NAME
xfs_check \- check XFS filesystem consistency
.SH SYNOPSIS
.B xfs_check
[
.B \-i
.I ino
] ... [
.B \-b
.I bno
] ... [
.B \-f
] [
.B \-s
] [
.B \-v
] [
.B \-l
.I logdev
]
.I device
.SH DESCRIPTION
.B xfs_check
checks whether an XFS filesystem is consistent.
It is normally run only when there is reason to believe that the
filesystem has a consistency problem.
The filesystem to be checked is specified by the
.I device
argument, which should be the disk or volume device for the filesystem.
Filesystems stored in files can also be checked, using the
.B \-f
flag. The filesystem should normally be unmounted or read-only
during the execution of
.BR xfs_check .
Otherwise, spurious problems are reported.
.SH
OPTIONS
.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.
.TP
.BI \-l " logdev"
Specifies the device where the filesystem's 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
.B \-s
Specifies that only serious errors should be reported.
Serious errors are those that make it impossible to find major data
structures in the filesystem. This option can be used to cut down the
amount of output when there is a serious problem, when the output
might make it difficult to see what the real problem is.
.TP
.B \-v
Specifies verbose output; it is impossibly long for a
reasonably-sized filesystem.
This option is intended for internal use only.
.TP
.BI \-i " ino"
Specifies verbose behavior for the specified inode
.IR ino .
For instance, it can be used to locate all the blocks
associated with a given inode.
.TP
.BI \-b " bno"
Specifies verbose behavior for the specific filesystem block at
.IR bno .
For instance, it can be used to determine what a specific block
is used for. The block number is a "file system block number".
Conversion between disk addresses (i.e. addresses reported by
.BR xfs_bmap (8))
and file system blocks may be accomplished using
.BR xfs_db "(8)'s " convert
command.
.PP
Any output that is produced when
.B xfs_check
is not run in verbose mode indicates that the filesystem has an
inconsistency. The filesystem can be repaired using either
.BR xfs_repair (8)
to fix the filesystem in place, or by using
.BR xfsdump (8)
and
.BR mkfs.xfs (8)
to dump the filesystem, make a new filesystem, then use
.BR xfsrestore (8)
to restore the data onto the new filesystem.
Note that xfsdump may fail on a corrupt filesystem.
However, if the filesystem is mountable, xfsdump can
be used to try and save important data before
repairing the filesystem with xfs_repair.
If the filesystem is not mountable though, xfs_repair is
the only viable option.
.SH DIAGNOSTICS
If the filesystem is completely corrupt, a core dump might
be produced instead of the message
.RS
.I device
.B is not a valid filesystem
.RE
.PP
If the filesystem is very large (has many files) then
.B xfs_check
might run out of memory. In this case the message
.RS
.B out of memory
.RE
is printed.
.PP
The following is a description of the most likely problems and the associated
messages.
Most of the diagnostics produced are only meaningful with an understanding
of the structure of the filesystem.
.TP
.BI "agf_freeblks " n ", counted " m " in ag " a
The freeblocks count in the allocation group header for allocation group
.I a
doesn't match the number of blocks counted free.
.TP
.BI "agf_longest " n ", counted " m " in ag " a
The longest free extent in the allocation group header for allocation group
.I a
doesn't match the longest free extent found in the allocation group.
.TP
.BI "agi_count " n ", counted " m " in ag " a
The allocated inode count in the allocation group header for allocation group
.I a
doesn't match the number of inodes counted in the allocation group.
.TP
.BI "agi_freecount " n ", counted " m " in ag " a
The free inode count in the allocation group header for allocation group
.I a
doesn't match the number of inodes counted free in the allocation group.
.TP
.BI "block " a/b " expected inum 0 got " i
The block number is specified as a pair
(allocation group number, block in the allocation group).
The block is used multiple times (shared), between multiple inodes.
This message usually follows a message of the next type.
.TP
.BI "block " a/b " expected type unknown got " y
The block is used multiple times (shared).
.TP
.BI "block " a/b " type unknown not expected
The block is unaccounted for (not in the freelist and not in use).
.TP
.BI "link count mismatch for inode " nnn " (name " xxx "), nlink " m ", counted " n
The inode has a bad link count (number of references in directories).
.TP
.BI "rtblock " b " expected inum 0 got " i
The block is used multiple times (shared), between multiple inodes.
This message usually follows a message of the next type.
.TP
.BI "rtblock " b " expected type unknown got " y
The real-time block is used multiple times (shared).
.TP
.BI "rtblock " b " type unknown not expected
The real-time block is unaccounted for (not in the freelist and not in use).
.TP
.BI "sb_fdblocks " n ", counted " m
The number of free data blocks recorded
in the superblock doesn't match the number counted free in the filesystem.
.TP
.BI "sb_frextents " n ", counted " m
The number of free real-time extents recorded
in the superblock doesn't match the number counted free in the filesystem.
.TP
.BI "sb_icount " n ", counted " m
The number of allocated inodes recorded
in the superblock doesn't match the number allocated in the filesystem.
.TP
.BI "sb_ifree " n ", counted " m
The number of free inodes recorded
in the superblock doesn't match the number free in the filesystem.
.SH SEE ALSO
.BR mkfs.xfs (8),
.BR xfsdump (8),
.BR xfsrestore (8),
.BR xfs_ncheck (8),
.BR xfs_repair (8),
.BR xfs (5).