.TH icheck "" "" Command
.PC "i-node consistency check"
\fBicheck [\-s] [\-b \fIN ...\fB] [ \-v ] \fIfilesystem ...\fR
.PP
.HS
.SH Options:
.IC \fB\-b\fR
The following numeric arguments give block numbers;
all references to these blocks are printed, with type
.IC \fB\-s\fR
Repair file system (requires write access)
.IC \fB\-v\fR
Print summary of information about file system
.HE
Each block in a file system must be either free (i.e., in the free list)
or allocated (i.e., associated with exactly one i-node).
.B icheck
examines each specified
.IR filesystem ,
printing block numbers that are claimed by more than one i-node,
or claimed by both an i-node and the free list.
It also checks for blocks that appear more than once
in the block list of an i-node or in the free list.
.PP
The option
.B -v
(verbose) causes
.B icheck
to print a summary of block usage in the
.IR filesystem .
The option
.B \-s
causes
.B icheck
to ignore the free list, to note which blocks are claimed by i-nodes,
and to rebuild the free list with the remainder.
A list of block numbers may be submitted with the
.B \-b
flag;
.B icheck
prints the data structure associated with each block
as the file system is scanned.
.PP
The raw device should be used, and the
.I filesystem
should be unmounted if possible.
If this is not possible (e.g., on the root file system) and the
.B \-s
option is used, the system must be rebooted immediately
to expunge the obsolete superblock.
.PP
The exit status bits for a bad return are as follows:
.DS
.ta 0.5i
\fB0x01\fR	Miscellaneous error (e.g. out of space)
\fB0x02\fR	Too hard to fix without human intervention
\fB0x04\fR	Bad free block
\fB0x08\fR	Missing blocks
\fB0x10\fR	Duplicates in free list
\fB0x20\fR	Bad block in free list
.DE
.SH "See Also"
.Xr "clri," clri
.Xr "commands," commands
.Xr "dcheck," dcheck
.Xr "fsck," fsck
.Xr "ncheck," ncheck
.Xr "sync," sync
.Xr "umount" umount
.SH Diagnostics
The message
``dups in free'' indicates a block is in the free list more than once.
``bad freelist'' indicates the presence of bad blocks on the free list.
A ``bad'' block is one that lies outside the bounds of the file system.
A ``dup'' (duplicated) block is one
associated with the free list and an i-node, or with more than one i-node.
All the errors above
.I must
be corrected before the file system is mounted.
``bad ifree'' means allocated i-nodes are on the free i-node list;
this is inconsequential.
.PP
This command has largely been replaced by
.BR fsck .
