fix a return value
[unix-history] / usr / src / sbin / icheck / icheck.8
CommitLineData
5fa428b1
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
46e11184 5.\" @(#)icheck.8 6.1 (Berkeley) %G%
5fa428b1 6.\"
46e11184 7.TH ICHECK 8 ""
5fa428b1
KM
8.UC 4
9.SH NAME
10icheck \- file system storage consistency check
11.SH SYNOPSIS
12.B /etc/icheck
13[
14.B \-s
15] [
16.B \-b
17numbers ]
18[ filesystem ]
19.SH DESCRIPTION
20.B N.B.:
21.I Icheck
22is obsoleted for normal consistency checking by
23.IR fsck (8).
24.PP
25.I Icheck
26examines a file system,
27builds a bit map of used blocks,
28and compares this bit map against
29the free list maintained on the file system.
30If the file system is not specified,
31a set of default file systems
32is checked.
33The normal output of
34.I icheck
35includes a report of
36.IP ""
37The total number of files and the numbers of
38regular, directory, block special and character special files.
39.IP ""
40The total number of blocks in use and the numbers of
41single-, double-, and triple-indirect blocks and directory blocks.
42.IP ""
43The number of free blocks.
44.IP ""
45The number of blocks missing; i.e. not in any file
46nor in the free list.
47.PP
48The
49.B \-s
50option causes
51.I icheck
52to ignore the actual free list and reconstruct a new one
53by rewriting the super-block of the file system.
54The file system should be dismounted while this is done;
55if this is not possible (for example if
56the root file system has to be salvaged)
57care should be taken that the system is quiescent and that
58it is rebooted immediately afterwards so that the old, bad in-core
59copy of the super-block will not continue to be used.
60Notice also that
61the words in the super-block
62which indicate the size of the free list and of the
63i-list are believed.
64If the super-block has been curdled
65these words will have to be patched.
66The
67.B \-s
68option
69causes the normal output reports to be suppressed.
70.PP
71Following the
72.B \-b
73option is a list of block numbers;
74whenever any of the named blocks turns up in a file,
75a diagnostic is produced.
76.PP
77.I Icheck
78is faster if the raw version of the special file is used,
79since it reads the i-list many blocks at a time.
80.SH FILES
81Default file systems vary with installation.
82.SH "SEE ALSO"
83fsck(8), dcheck(8), ncheck(8),
e46678a9 84fs(5), clri(8)
5fa428b1
KM
85.SH DIAGNOSTICS
86For duplicate blocks
87and bad blocks (which lie outside the file system)
88.I icheck
89announces the difficulty, the i-number, and the kind of block involved.
90If a read error is encountered,
91the block number of the bad block is printed and
92.I icheck
93considers it to contain 0.
94`Bad freeblock' means that
95a block number outside the available space was encountered in the free list.
96`\fIn\fR dups in free'
97means that
98.IR n ""
99blocks were found in the free list which
100duplicate blocks either in some file or in the earlier part of the free list.
101.SH BUGS
102Since
103.I icheck
104is inherently two-pass in nature, extraneous diagnostics
105may be produced if applied to active file systems.
106.PP
107It believes even preposterous super-blocks and
108consequently can get core images.
109.PP
110The system should be fixed so that the reboot after fixing the root
111file system is not necessary.