V8/usr/man/man8/icheck.8

Compare this file to the similar file:
Show the results in this format:

.TH ICHECK 8 
.SH NAME
icheck, dcheck, ncheck \- file system consistency check
.SH SYNOPSIS
.B /etc/icheck
[
.B \-B
] [
.B \-s
] [
.B \-b
numbers ]
[ filesystem ]
.sp
.B /etc/dcheck
[
.B \-B
] [
.B \-i
numbers ]
[ filesystem ]
.sp
.B /etc/ncheck
[
.B \-B
] [
.B \-i
numbers ] [
.B \-a
] [
.B \-s
]
[ filesystem ]
.SH DESCRIPTION
These programs perform
consistency checks
on file systems.
For normal file system
maintenance,
see
.IR fsck (8).
.PP
.I Icheck
examines a file system,
builds a bit map of used blocks,
and compares this bit map against
the free list maintained on the file system.
If the file system is not specified,
a set of default file systems
is checked.
The normal output of
.I icheck
includes a report of
.IP ""
The total number of files and the numbers of
regular, directory, block special and character special files.
.IP ""
The total number of blocks in use and the numbers of 
single-, double-, and triple-indirect blocks and directory blocks.
.IP ""
The number of free blocks.
.IP ""
The number of blocks missing;
.I i.e.\&
not in any file
nor in the free list.
.PP
The
.B \-s
option causes
.I icheck
to ignore the actual free list and reconstruct a new one
by rewriting the super-block of the file system.
The file system should be dismounted while this is done;
if this is not possible (for example if
the root file system has to be salvaged)
care should be taken that the system is quiescent.
The words in the super-block
which indicate the size of the free list and of the
i-list are believed.
If the super-block has been curdled
these words will have to be patched.
The
.B \-s
option
causes the normal output reports to be suppressed.
.PP
Following the
.B \-b
option is a list of block numbers;
whenever any of the named blocks turns up in a file
or the free list,
a diagnostic is produced.
.PP
.I Dcheck
reads the directories in a file system
and compares
the link-count in each i-node with the number of directory
entries by which it is referenced.
The
.B \-i
flag
is followed by a list of i-numbers;
when one of those i-numbers turns up
in a directory,
the number, the i-number of the directory,
and the name of the entry are reported.
.PP
.I Ncheck
generates a pathname vs. i-number
list of all files
in a file system.
Names of directory files are followed by `/\fB.\fR'.
The
.B \-i
option reduces the report to only those files whose i-numbers follow.
The
.B \-a
option
allows printing of the names
.RB ` . '
and
.RB ` .. ',
which are ordinarily suppressed.
The
.B \-s
option reduces the report to special files
and files with set-user-ID mode;
it is intended to discover concealed violations
of security policy.
The report is in no useful
order, and probably should be sorted.
.PP
These programs are
faster if the raw version of the special file is used,
since they read the i-list many blocks at a time.
.PP
If
.I filesystem
is a special file,
the minor device number is checked
to distinguish between regular
and bitmapped
file systems.
If the
.I filesystem
resides in a regular file,
it is assumed to be a regular file system
unless the
.B \-B
option
is used.
.SH FILES
Default file systems vary with installation.
.SH "SEE ALSO"
fsck(8),
filsys(5), clri(8)
.SH DIAGNOSTICS
For duplicate blocks
and bad blocks (which lie outside the file system)
.I icheck
announces the difficulty, the i-number, and the kind of block involved.
If a read error is encountered,
the block number of the bad block is printed and
.I icheck
considers it to contain 0.
`Bad freeblock' means that
a block number outside the available space was encountered in the free list.
`\fIn\fR dups in free'
means that
.IR n ""
blocks were found in the free list which
duplicate blocks either in some file or in the earlier part of the free list.
.PP
When a file turns up for which the link-count and the number
of directory entries disagree,
.I dcheck
reports the relevant facts.
Allocated files which have 0 link-count and no entries are also
listed.
The only dangerous situation
occurs when there are more entries than links;
if entries are removed,
so the link-count drops to 0,
the remaining entries point to thin air.
They should be removed.
When there are more links than entries, or there is
an allocated file with neither links nor entries,
some disk space may be lost but the situation will not degenerate.
.PP
When the filesystem structure is improper,
.I ncheck
prints
`??' to denote the `parent' of
a parentless file.
A pathname beginning with `...' denotes a loop.
.SH BUGS
Since
these commands
are inherently two-pass in nature, extraneous diagnostics
may be produced if applied to active file systems.
.PP
They believe even preposterous super-blocks and
consequently can get core images.