Fsck is a multi-pass file system check program. Each file system pass invokes a different Phase of the fsck program. After the initial setup, fsck performs successive Phases over each file system, checking blocks and sizes, path-names, connectivity, reference counts, and the map of free blocks, (possibly rebuilding it), and performs some cleanup.
Normally fsck is run non-interactively to preen the file systems after an unclean halt. While preen'ing a file system, it will only fix corruptions that are expected to occur from an unclean halt. These actions are a proper subset of the actions that fsck will take when it is running interactively. Throughout this appendix many errors have several options that the operator can take. When an inconsistency is detected, fsck reports the error condition to the operator. If a response is required, fsck prints a prompt message and waits for a response. When preen'ing most errors are fatal. For those that are expected, the response taken is noted. This appendix explains the meaning of each error condition, the possible responses, and the related error conditions.
The error conditions are organized by the Phase of the fsck program in which they can occur. The error conditions that may occur in more than one Phase will be discussed in initialization.
Before a file system check can be performed, certain tables have to be set up and certain files opened. This section concerns itself with the opening of files and the initialization of tables. This section lists error conditions resulting from command line options, memory requests, opening of files, status of files, file system size checks, and creation of the scratch file. All the initialization errors are fatal when the file system is being preen'ed.
C option?
C is not a legal option to
fsck;
legal options are -b, -c, -y, -n, and -p.
Fsck
terminates on this error condition.
See the
fsck(8)
manual entry for further detail.
cannot alloc NNN bytes for blockmap
cannot alloc NNN bytes for freemap
cannot alloc NNN bytes for statemap
cannot alloc NNN bytes for lncntp
Fsck's
request for memory for its virtual
memory tables failed.
This should never happen.
Fsck
terminates on this error condition.
See a guru.
Can't open checklist file: F
The file system checklist file
F (usually
/etc/fstab)
can not be opened for reading.
Fsck
terminates on this error condition.
Check access modes of F.
Can't stat root
Fsck's
request for statistics about the root directory ``/'' failed.
This should never happen.
Fsck
terminates on this error condition.
See a guru.
Can't stat F
Can't make sense out of name F
Fsck's
request for statistics about the file system F failed.
When running manually,
it ignores this file system
and continues checking the next file system given.
Check access modes of F.
Can't open F
Fsck's
request attempt to open the file system F failed.
When running manually, it ignores this file system
and continues checking the next file system given.
Check access modes of F.
F: (NO WRITE)
Either the -n flag was specified or
fsck's
attempt to open the file system F for writing failed.
When running manually,
all the diagnostics are printed out,
but no modifications are attempted to fix them.
file is not a block or character device; OK
You have given
fsck
a regular file name by mistake.
Check the type of the file specified.
Possible responses to the OK prompt are:
UNDEFINED OPTIMIZATION IN SUPERBLOCK (SET TO DEFAULT)
The superblock optimization parameter is neither OPT_TIME
nor OPT_SPACE.
Possible responses to the SET TO DEFAULT prompt are:
IMPOSSIBLE MINFREE=D IN SUPERBLOCK (SET TO DEFAULT)
The superblock minimum space percentage is greater than 99%
or less then 0%.
Possible responses to the SET TO DEFAULT prompt are:
IMPOSSIBLE INTERLEAVE=D IN SUPERBLOCK (SET TO DEFAULT)
The file system interleave is less than or equal to zero.
Possible responses to the SET TO DEFAULT prompt are:
IMPOSSIBLE NPSECT=D IN SUPERBLOCK (SET TO DEFAULT)
The number of physical sectors per track is less than the number
of usable sectors per track.
Possible responses to the SET TO DEFAULT prompt are:
One of the following messages will appear:
MAGIC NUMBER WRONG
NCG OUT OF RANGE
CPG OUT OF RANGE
NCYL DOES NOT JIVE WITH NCG*CPG
SIZE PREPOSTEROUSLY LARGE
TRASHED VALUES IN SUPER BLOCK
and will be followed by the message:
F: BAD SUPER BLOCK: B
USE -b OPTION TO FSCK TO SPECIFY LOCATION OF AN ALTERNATE
SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(8).
The super block has been corrupted.
An alternative super block must be selected from among those
listed by
newfs
(8) when the file system was created.
For file systems with a blocksize less than 32K,
specifying -b 32 is a good first choice.
INTERNAL INCONSISTENCY: M
Fsck's
has had an internal panic, whose message is specified as M.
This should never happen.
See a guru.
CAN NOT SEEK: BLK B (CONTINUE)
Fsck's
request for moving to a specified block number B in
the file system failed.
This should never happen.
See a guru.
Possible responses to the CONTINUE prompt are:
CAN NOT READ: BLK B (CONTINUE)
Fsck's
request for reading a specified block number B in
the file system failed.
This should never happen.
See a guru.
Possible responses to the CONTINUE prompt are:
CAN NOT WRITE: BLK B (CONTINUE)
Fsck's
request for writing a specified block number B
in the file system failed.
The disk is write-protected;
check the write protect lock on the drive.
If that is not the problem, see a guru.
Possible responses to the CONTINUE prompt are:
bad inode number DDD to ginode
An internal error has attempted to read non-existent inode DDD.
This error causes
fsck
to exit.
See a guru.
This phase concerns itself with the inode list. This section lists error conditions resulting from checking inode types, setting up the zero-link-count table, examining inode block numbers for bad or duplicate blocks, checking inode size, and checking inode format. All errors in this phase except INCORRECT BLOCK COUNT and PARTIALLY TRUNCATED INODE are fatal if the file system is being preen'ed.
UNKNOWN FILE TYPE I=I (CLEAR)
The mode word of the inode I indicates that the inode is not a
special block inode, special character inode, socket inode, regular inode,
symbolic link, or directory inode.
Possible responses to the CLEAR prompt are:
PARTIALLY TRUNCATED INODE I=I (SALVAGE)
Fsck
has found inode I whose size is shorter than the number of
blocks allocated to it.
This condition should only occur if the system crashes while in the
midst of truncating a file.
When preen'ing the file system,
fsck
completes the truncation to the specified size.
Possible responses to SALVAGE are:
LINK COUNT TABLE OVERFLOW (CONTINUE)
An internal table for
fsck
containing allocated inodes with a link count of
zero cannot allocate more memory.
Increase the virtual memory for
fsck.
Possible responses to the CONTINUE prompt are:
B BAD I=I
Inode I contains block number B with a number
lower than the number of the first data block in the file system or
greater than the number of the last block
in the file system.
This error condition may invoke the
EXCESSIVE BAD BLKS
error condition in Phase 1 (see next paragraph) if
inode I has too many block numbers outside the file system range.
This error condition will always invoke the
BAD/DUP
error condition in Phase 2 and Phase 4.
EXCESSIVE BAD BLKS I=I (CONTINUE)
There is more than a tolerable number (usually 10) of blocks with a number
lower than the number of the first data block in the file system or greater than
the number of last block in the file system associated with inode I.
Possible responses to the CONTINUE prompt are:
BAD STATE DDD TO BLKERR
An internal error has scrambled
fsck's
state map to have the impossible value DDD.
Fsck
exits immediately.
See a guru.
B DUP I=I
Inode I contains block number B that is already claimed by
another inode.
This error condition may invoke the
EXCESSIVE DUP BLKS
error condition in Phase 1 if
inode I has too many block numbers claimed by other inodes.
This error condition will always invoke Phase 1b and the
BAD/DUP
error condition in Phase 2 and Phase 4.
EXCESSIVE DUP BLKS I=I (CONTINUE)
There is more than a tolerable number (usually 10) of blocks claimed by other
inodes.
Possible responses to the CONTINUE prompt are:
DUP TABLE OVERFLOW (CONTINUE)
An internal table in
fsck
containing duplicate block numbers cannot allocate any more space.
Increase the amount of virtual memory available to
fsck.
Possible responses to the CONTINUE prompt are:
PARTIALLY ALLOCATED INODE I=I (CLEAR)
Inode I is neither allocated nor unallocated.
Possible responses to the CLEAR prompt are:
INCORRECT BLOCK COUNT I=I (X should be Y) (CORRECT)
The block count for inode I is X blocks,
but should be Y blocks.
When preen'ing the count is corrected.
Possible responses to the CORRECT prompt are:
When a duplicate block is found in the file system, the file system is rescanned to find the inode that previously claimed that block. This section lists the error condition when the duplicate block is found.
B DUP I=I
Inode I contains block number B that
is already claimed by another inode.
This error condition will always invoke the
BAD/DUP
error condition in Phase 2.
You can determine which inodes have overlapping blocks by examining
this error condition and the DUP error condition in Phase 1.
This phase concerns itself with removing directory entries pointing to error conditioned inodes from Phase 1 and Phase 1b. This section lists error conditions resulting from root inode mode and status, directory inode pointers in range, and directory entries pointing to bad inodes, and directory integrity checks. All errors in this phase are fatal if the file system is being preen'ed, except for directories not being a multiple of the blocks size and extraneous hard links.
ROOT INODE UNALLOCATED (ALLOCATE)
The root inode (usually inode number 2) has no allocate mode bits.
This should never happen.
Possible responses to the ALLOCATE prompt are:
ROOT INODE NOT DIRECTORY (REALLOCATE)
The root inode (usually inode number 2)
is not directory inode type.
Possible responses to the REALLOCATE prompt are:
Possible responses to the FIX prompt are:
DUPS/BAD IN ROOT INODE (REALLOCATE)
Phase 1 or Phase 1b have found duplicate blocks
or bad blocks in the root inode (usually inode number 2) for the file system.
Possible responses to the REALLOCATE prompt are:
Possible responses to the CONTINUE prompt are:
NAME TOO LONG F
An excessively long path name has been found.
This usually indicates loops in the file system name space.
This can occur if the super user has made circular links to directories.
The offending links must be removed (by a guru).
I OUT OF RANGE I=I NAME=F (REMOVE)
A directory entry F has an inode number I that is greater than
the end of the inode list.
Possible responses to the REMOVE prompt are:
UNALLOCATED I=I OWNER=O MODE=M SIZE=S MTIME=T type=F (REMOVE)
A directory or file entry F points to an unallocated inode I.
The owner O, mode M, size S, modify time T,
and name F are printed.
Possible responses to the REMOVE prompt are:
DUP/BAD I=I OWNER=O MODE=M SIZE=S MTIME=T type=F (REMOVE)
Phase 1 or Phase 1b have found duplicate blocks or bad blocks
associated with directory or file entry F, inode I.
The owner O, mode M, size S, modify time T,
and directory name F are printed.
Possible responses to the REMOVE prompt are:
ZERO LENGTH DIRECTORY I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F (REMOVE)
A directory entry F has a size S that is zero.
The owner O, mode M, size S, modify time T,
and directory name F are printed.
Possible responses to the REMOVE prompt are:
DIRECTORY TOO SHORT I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F (FIX)
A directory F has been found whose size S
is less than the minimum size directory.
The owner O, mode M, size S, modify time T,
and directory name F are printed.
Possible responses to the FIX prompt are:
DIRECTORY F LENGTH S NOT MULTIPLE OF B (ADJUST)
A directory F has been found with size S that is not
a multiple of the directory blocksize B.
Possible responses to the ADJUST prompt are:
DIRECTORY CORRUPTED I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F (SALVAGE)
A directory with an inconsistent internal state has been found.
Possible responses to the FIX prompt are:
BAD INODE NUMBER FOR `.' I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F (FIX)
A directory I has been found whose inode number for `.' does
does not equal I.
Possible responses to the FIX prompt are:
MISSING `.' I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F (FIX)
A directory I has been found whose first entry is unallocated.
Possible responses to the FIX prompt are:
MISSING `.' I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F
CANNOT FIX, FIRST ENTRY IN DIRECTORY CONTAINS F
A directory I has been found whose first entry is F.
Fsck
cannot resolve this problem.
The file system should be mounted and the offending entry F
moved elsewhere.
The file system should then be unmounted and
fsck
should be run again.
MISSING `.' I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F
CANNOT FIX, INSUFFICIENT SPACE TO ADD `.'
A directory I has been found whose first entry is not `.'.
Fsck
cannot resolve this problem as it should never happen.
See a guru.
EXTRA `.' ENTRY I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F (FIX)
A directory I has been found that has more than one entry for `.'.
Possible responses to the FIX prompt are:
BAD INODE NUMBER FOR `..' I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F (FIX)
A directory I has been found whose inode number for `..' does
does not equal the parent of I.
Possible responses to the FIX prompt are:
MISSING `..' I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F (FIX)
A directory I has been found whose second entry is unallocated.
Possible responses to the FIX prompt are:
MISSING `..' I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F
CANNOT FIX, SECOND ENTRY IN DIRECTORY CONTAINS F
A directory I has been found whose second entry is F.
Fsck
cannot resolve this problem.
The file system should be mounted and the offending entry F
moved elsewhere.
The file system should then be unmounted and
fsck
should be run again.
MISSING `..' I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F
CANNOT FIX, INSUFFICIENT SPACE TO ADD `..'
A directory I has been found whose second entry is not `..'.
Fsck
cannot resolve this problem.
The file system should be mounted and the second entry in the directory
moved elsewhere.
The file system should then be unmounted and
fsck
should be run again.
EXTRA `..' ENTRY I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F (FIX)
A directory I has been found that has more than one entry for `..'.
Possible responses to the FIX prompt are:
N IS AN EXTRANEOUS HARD LINK TO A DIRECTORY D (REMOVE)
Fsck
has found a hard link, N, to a directory, D.
When preen'ing the extraneous links are ignored.
Possible responses to the REMOVE prompt are:
BAD INODE S TO DESCEND
An internal error has caused an impossible state S to be passed to the
routine that descends the file system directory structure.
Fsck
exits.
See a guru.
BAD RETURN STATE S FROM DESCEND
An internal error has caused an impossible state S to be returned
from the routine that descends the file system directory structure.
Fsck
exits.
See a guru.
BAD STATE S FOR ROOT INODE
An internal error has caused an impossible state S to be assigned
to the root inode.
Fsck
exits.
See a guru.
This phase concerns itself with the directory connectivity seen in Phase 2. This section lists error conditions resulting from unreferenced directories, and missing or full lost+found directories.
UNREF DIR I=I OWNER=O MODE=M SIZE=S MTIME=T (RECONNECT)
The directory inode I was not connected to a directory entry
when the file system was traversed.
The owner O, mode M, size S, and
modify time T of directory inode I are printed.
When preen'ing, the directory is reconnected if its size is non-zero,
otherwise it is cleared.
Possible responses to the RECONNECT prompt are:
NO lost+found DIRECTORY (CREATE)
There is no
lost+found
directory in the root directory of the file system;
When preen'ing
fsck
tries to create a lost+found directory.
Possible responses to the CREATE prompt are:
lost+found IS NOT A DIRECTORY (REALLOCATE)
The entry for
lost+found
is not a directory.
Possible responses to the REALLOCATE prompt are:
NO SPACE LEFT IN /lost+found (EXPAND)
There is no space to add another entry to the
lost+found
directory in the root directory
of the file system.
When preen'ing the
lost+found
directory is expanded.
Possible responses to the EXPAND prompt are:
DIR I=I1 CONNECTED. PARENT WAS I=I2
This is an advisory message indicating a directory inode I1 was
successfully connected to the
lost+found
directory.
The parent inode I2 of the directory inode I1 is
replaced by the inode number of the
lost+found
directory.
DIRECTORY F LENGTH S NOT MULTIPLE OF B (ADJUST)
A directory F has been found with size S that is not
a multiple of the directory blocksize B
(this can reoccur in Phase 3 if it is not adjusted in Phase 2).
Possible responses to the ADJUST prompt are:
BAD INODE S TO DESCEND
An internal error has caused an impossible state S to be passed to the
routine that descends the file system directory structure.
Fsck
exits.
See a guru.
This phase concerns itself with the link count information seen in Phase 2 and Phase 3. This section lists error conditions resulting from unreferenced files, missing or full lost+found directory, incorrect link counts for files, directories, symbolic links, or special files, unreferenced files, symbolic links, and directories, and bad or duplicate blocks in files, symbolic links, and directories. All errors in this phase are correctable if the file system is being preen'ed except running out of space in the lost+found directory.
UNREF FILE I=I OWNER=O MODE=M SIZE=S MTIME=T (RECONNECT)
Inode I was not connected to a directory entry
when the file system was traversed.
The owner O, mode M, size S, and
modify time T of inode I are printed.
When preen'ing the file is cleared if either its size or its
link count is zero,
otherwise it is reconnected.
Possible responses to the RECONNECT prompt are:
(CLEAR)
The inode mentioned in the immediately previous error condition can not be
reconnected.
This cannot occur if the file system is being preen'ed,
since lack of space to reconnect files is a fatal error.
Possible responses to the CLEAR prompt are:
NO lost+found DIRECTORY (CREATE)
There is no
lost+found
directory in the root directory of the file system;
When preen'ing
fsck
tries to create a lost+found directory.
Possible responses to the CREATE prompt are:
lost+found IS NOT A DIRECTORY (REALLOCATE)
The entry for
lost+found
is not a directory.
Possible responses to the REALLOCATE prompt are:
NO SPACE LEFT IN /lost+found (EXPAND)
There is no space to add another entry to the
lost+found
directory in the root directory
of the file system.
When preen'ing the
lost+found
directory is expanded.
Possible responses to the EXPAND prompt are:
LINK COUNT type I=I OWNER=O MODE=M SIZE=S MTIME=T COUNT=X SHOULD BE Y (ADJUST)
The link count for inode I,
is X but should be Y.
The owner O, mode M, size S, and modify time T
are printed.
When preen'ing the link count is adjusted unless the number of references
is increasing, a condition that should never occur unless precipitated
by a hardware failure.
When the number of references is increasing under preen mode,
fsck
exits with the message:
LINK COUNT INCREASING
Possible responses to the ADJUST prompt are:
UNREF type I=I OWNER=O MODE=M SIZE=S MTIME=T (CLEAR)
Inode I, was not connected to a directory entry when the
file system was traversed.
The owner O, mode M, size S,
and modify time T of inode I
are printed.
When preen'ing,
this is a file that was not connected because its size or link count was zero,
hence it is cleared.
Possible responses to the CLEAR prompt are:
BAD/DUP type I=I OWNER=O MODE=M SIZE=S MTIME=T (CLEAR)
Phase 1 or Phase 1b have found duplicate blocks
or bad blocks associated with
inode I.
The owner O, mode M, size S,
and modify time T of inode I
are printed.
This error cannot arise when the file system is being preen'ed,
as it would have caused a fatal error earlier.
Possible responses to the CLEAR prompt are:
This phase concerns itself with the free-block and used-inode maps. This section lists error conditions resulting from allocated blocks in the free-block maps, free blocks missing from free-block maps, and the total free-block count incorrect. It also lists error conditions resulting from free inodes in the used-inode maps, allocated inodes missing from used-inode maps, and the total used-inode count incorrect.
CG C: BAD MAGIC NUMBER
The magic number of cylinder group C is wrong.
This usually indicates that the cylinder group maps have been destroyed.
When running manually the cylinder group is marked as needing
to be reconstructed.
This error is fatal if the file system is being preen'ed.
BLK(S) MISSING IN BIT MAPS (SALVAGE)
A cylinder group block map is missing some free blocks.
During preen'ing the maps are reconstructed.
Possible responses to the SALVAGE prompt are:
SUMMARY INFORMATION BAD (SALVAGE)
The summary information was found to be incorrect.
When preen'ing,
the summary information is recomputed.
Possible responses to the SALVAGE prompt are:
FREE BLK COUNT(S) WRONG IN SUPERBLOCK (SALVAGE)
The superblock free block information was found to be incorrect.
When preen'ing,
the superblock free block information is recomputed.
Possible responses to the SALVAGE prompt are:
Once a file system has been checked, a few cleanup functions are performed. This section lists advisory messages about the file system and modify status of the file system.
V files, W used, X free (Y frags, Z blocks)
This is an advisory message indicating that
the file system checked contained
V files using
W fragment sized blocks leaving
X fragment sized blocks free in the file system.
The numbers in parenthesis breaks the free count down into
Y free fragments and
Z free full sized blocks.
***** REBOOT UNIX *****
This is an advisory message indicating that
the root file system has been modified by
fsck.
If UNIX is not rebooted immediately,
the work done by
fsck
may be undone by the in-core copies of tables
UNIX keeps.
When preen'ing,
fsck
will exit with a code of 4.
The standard auto-reboot script distributed with 4.3BSD
interprets an exit code of 4 by issuing a reboot system call.
***** FILE SYSTEM WAS MODIFIED *****
This is an advisory message indicating that
the current file system was modified by
fsck.
If this file system is mounted or is the current root file system,
fsck
should be halted and UNIX rebooted.
If UNIX is not rebooted immediately,
the work done by
fsck
may be undone by the in-core copies of tables
UNIX keeps.