FSCK(1M) FSCK(1M)
NAME
fsck, dfsck - check and repair file systems
SYNOPSIS
/etc/fsck [-y] [-n] [-sX] [-SX] [-t file] [-q] [-D] [-f]
[-b] [file-systems]
/etc/dfsck [options1] fsys1 ... - [options2] fsys2 ...
DESCRIPTION
Fsck
fsck audits and interactively repairs inconsistent
conditions for file systems. If the file system is found to
be consistent, the number of files, blocks used, and blocks
free are reported. If the file system is inconsistent the
user is prompted for concurrence before each correction is
attempted. It should be noted that most corrective actions
will result in some loss of data. The amount and severity
of data loss may be determined from the diagnostic output.
The default action for each correction is to wait for the
user to respond yes or no. If the user does not have write
permission fsck defaults to a -n action.
The following options are accepted by fsck.
-y Assume a yes response to all questions asked by fsck.
-n Assume a no response to all questions asked by fsck;
do not open the file system for writing.
-sX Ignore the actual free list and (unconditionally)
reconstruct a new one by rewriting the super-block of
the file system. The file system should be unmounted
while this is done; if this is not possible, care
should be taken that the system is quiescent and that
it is rebooted immediately afterwards. This
precaution is necessary so that the old, bad, in-core
copy of the superblock will not continue to be used,
or written on the file system.
The -sX option allows for creating an optimal free-
list organization.
If X is not given, the values used when the file
system was created are used. The format of X is
cylinder size:gap size.
-SX Conditionally reconstruct the free list. This option
is like -sX above except that the free list is rebuilt
only if there were no discrepancies discovered in the
file system. Using -S will force a no response to all
questions asked by fsck. This option is useful for
forcing free list reorganization on uncontaminated
Page 1 (last mod. 8/20/87)
FSCK(1M) FSCK(1M)
file systems.
-t If fsck cannot obtain enough memory to keep its
tables, it uses a scratch file. If the -t option is
specified, the file named in the next argument is used
as the scratch file, if needed. Without the -t flag,
fsck will prompt the user for the name of the scratch
file. The file chosen should not be on the file system
being checked, and if it is not a special file or did
not already exist, it is removed when fsck completes.
-q Quiet fsck. Do not print size-check messages.
Unreferenced fifos will silently be removed. If fsck
requires it, counts in the superblock will be
automatically fixed and the free list salvaged.
-D Directories are checked for bad blocks. Useful after
system crashes.
-f Fast check. Check block and sizes and check the free
list. The free list will be reconstructed if it is
necessary.
-b Reboot. If the file system being checked is the root
file system and modifications have been made, then
either remount the root file system or reboot the
system. A remount is done only if there was minor
damage.
If no file-systems are specified, fsck will read a list of
default file systems from the file /etc/checklist.
Inconsistencies checked are as follows:
1. Blocks claimed by more than one i-node or the
free list.
2. Blocks claimed by an i-node or the free list
outside the range of the file system.
3. Incorrect link counts.
4. Size checks:
Incorrect number of blocks.
Directory size not 16-byte aligned.
5. Bad i-node format.
6. Blocks not accounted for anywhere.
7. Directory checks:
File pointing to unallocated i-node.
I-node number out of range.
8. Super Block checks:
More than 65536 i-nodes.
More blocks for i-nodes than there are in
the file system.
9. Bad free block list format.
10. Total free block and/or free i-node count
Page 2 (last mod. 8/20/87)
FSCK(1M) FSCK(1M)
incorrect.
Orphaned files and directories (allocated but unreferenced)
are, with the user's concurrence, reconnected by placing
them in the lost+found directory, if the files are nonempty.
The user will be notified if the file or directory is empty
or not. Empty files or directories are removed, as long as
the -n option is not specified. fsck will force the
reconnection of nonempty directories. The name assigned is
the i-node number. The only restriction is that the
directory lost+found must preexist in the root of the file
system being checked and must have empty slots in which
entries can be made. This is accomplished by making
lost+found, copying a number of files to the directory, and
then removing them (before fsck is executed).
Checking the raw device is almost always faster and should
be used with everything but the root file system.
Dfsck
Dfsck should not be used to check the root file system.
Dfsck allows two file system checks on two different drives
simultaneously. options1 and options2 are used to pass
options to fsck for the two sets of file systems. A - is
the separator between the file system groups.
The dfsck program permits a user to interact with two fsck
programs at once. To aid in this, dfsck will print the file
system name for each message to the user. When answering a
question from dfsck, the user must prefix the response with
a 1 or a 2 (indicating that the answer refers to the first
or second file system group).
FILES
/etc/checklist contains default list of file systems
to check.
SEE ALSO
checkfsys(1M), mkfs(1M), ncheck(1M), crash(1M).
uadmin(2), checklist(4), fs(4) in the Programmer's Reference
Manual.
BUGS
I-node numbers for . and .. in each directory are not
checked for validity.
ORIGIN
AT&T V.3
Page 3 (last mod. 8/20/87)