xref: /386bsd/usr/share/man/cat8/fsck.0 (revision a2142627)
1
2
3
4FSCK(8)                        1991                       FSCK(8)
5
6
7NNAAMMEE
8       fsck  -  file  system  consistency  check  and interactive
9       repair
10
11SSYYNNOOPPSSIISS
12       ffsscckk --pp [ --mm mode ]
13       ffsscckk [ --bb block# ] [ --cc ] [ --yy ] [ --nn ]  [  --mm  mode  ]  [
14       filesystem ] ...
15
16DDEESSCCRRIIPPTTIIOONN
17       The   first   form  of  _f_s_c_k  preens  a  standard  set  of
18       filesystems or the specified file systems.  It is normally
19       used  in the script //eettcc//rrcc during automatic reboot.  Here
20       _f_s_c_k reads the table //eettcc//ffssttaabb to  determine  which  file
21       systems  to  check.   Only  partitions  in  fstab that are
22       mounted ``rw,'' ``rq'' or ``ro'' and  that  have  non-zero
23       pass  number  are checked.  Filesystems with pass number 1
24       (normally just the root filesystem) are checked one  at  a
25       time.   When  pass  1 completes, all remaining filesystems
26       are checked, running one process per disk drive.  The disk
27       drive  containing  each  filesystem  is  inferred from the
28       longest prefix of the device name that ends  in  a  digit;
29       the  remaining  characters are assumed to be the partition
30       designator.
31
32       The system takes care that  only  a  restricted  class  of
33       innocuous  inconsistencies  can  happen unless hardware or
34       software failures intervene.  These  are  limited  to  the
35       following:
36
37              Unreferenced inodes
38
39              Link counts in inodes too large
40
41              Missing blocks in the free map
42
43              Blocks in the free map also in files
44
45              Counts in the super-block wrong
46
47       These  are  the only inconsistencies that _f_s_c_k with the --pp
48       option   will   correct;   if    it    encounters    other
49       inconsistencies,  it  exits with an abnormal return status
50       and  an  automatic  reboot  will  then  fail.   For   each
51       corrected  inconsistency one or more lines will be printed
52       identifying the file system on which the  correction  will
53       take  place,  and  the  nature  of  the correction.  After
54       successfully correcting a file system, _f_s_c_k will print the
55       number  of  files  on that file system, the number of used
56       and free blocks, and the percentage of fragmentation.
57
58       If sent a QUIT signal, _f_s_c_k will finish  the  file  system
59       checks,  then  exit  with  an  abnormal return status that
60       causes an automatic reboot to fail.  This is  useful  when
61
62
63
6420,                           April                             1
65
66
67
68
69
70FSCK(8)                        1991                       FSCK(8)
71
72
73       to  finish  the  file  system  checks  during an automatic
74       reboot, but do not want the machine to come  up  multiuser
75       after the checks complete.
76
77       Without  the  --pp  option,  _f_s_c_k  audits  and interactively
78       repairs inconsistent conditions for file systems.  If  the
79       file  system  is inconsistent the operator is prompted for
80       concurrence  before  each  correction  is  attempted.   It
81       should  be noted that some of the corrective actions which
82       are not correctable under the --pp  option  will  result  in
83       some  loss  of data.  The amount and severity of data lost
84       may be determined from the diagnostic output.  The default
85       action  for each consistency correction is to wait for the
86       operator to respond yyeess or nnoo.  If the operator  does  not
87       have write permission on the file system _f_s_c_k will default
88       to a --nn action.
89
90       _F_s_c_k has more consistency  checks  than  its  predecessors
91       _c_h_e_c_k, _d_c_h_e_c_k, _f_c_h_e_c_k, and _i_c_h_e_c_k combined.
92
93       The following flags are interpreted by _f_s_c_k.
94
95       --bb    Use  the  block specified immediately after the flag
96             as the super block for the file system.  Block 32 is
97             usually an alternate super block.
98
99       --ll    Limit  the  number  of parallel checks to the number
100             specified in the following  argument.   By  default,
101             the  limit  is  the  number  of  disks,  running one
102             process per disk.  If a smaller limit is given,  the
103             disks  are  checked round-robin, one filesystem at a
104             time.
105
106       --mm    Use the mode specified in  octal  immediately  after
107             the flag as the permission bits to use when creating
108             the lost+found directory  rather  than  the  default
109             1777.   In  particular,  systems that do not wish to
110             have lost files  accessible  by  all  users  on  the
111             system   should   use  a  more  restrictive  set  of
112             permissions such as 700.
113
114       --yy    Assume a yes response  to  all  questions  asked  by
115             _f_s_c_k; this should be used with great caution as this
116             is a free  license  to  continue  after  essentially
117             unlimited trouble has been encountered.
118
119       --nn    Assume  a no response to all questions asked by _f_s_c_k
120             except for ``CONTINUE?'', which  is  assumed  to  be
121             affirmative;   do  not  open  the  file  system  for
122             writing.
123
124       --cc    If the file system is  in  the  old  (static  table)
125             format,  convert  it  to  the  new  (dynamic  table)
126             format.  If the file system is in  the  new  format,
127
128
129
13020,                           April                             2
131
132
133
134
135
136FSCK(8)                        1991                       FSCK(8)
137
138
139             convert it to the old format provided the old format
140             can  support  the  filesystem   configuration.    In
141             interactive  mode,  _f_s_c_k will list the direction the
142             conversion  is  to  be  made  and  ask  whether  the
143             conversion  should be done.  If a negative answer is
144             given,  no  further  operations  are  done  on   the
145             filesystem.   In  preen  mode,  the direction of the
146             conversion is listed and done  if  possible  without
147             user  interaction.  Conversion in preen mode is best
148             used when all the file systems are  being  converted
149             at  once.   The  format  of  a  file  system  can be
150             determined  from  the  first  line  of  output  from
151             _d_u_m_p_f_s(8).
152
153       If no filesystems are given to _f_s_c_k then a default list of
154       file systems is read from the file //eettcc//ffssttaabb.
155
156       Inconsistencies checked are as follows:
157
158       1.    Blocks claimed by more than one inode  or  the  free
159             map.
160       2.    Blocks  claimed by an inode outside the range of the
161             file system.
162       3.    Incorrect link counts.
163       4.    Size checks:
164                   Directory size not of proper format.
165                   Partially truncated file.
166       5.    Bad inode format.
167       6.    Blocks not accounted for anywhere.
168       7.    Directory checks:
169                   File pointing to unallocated inode.
170                   Inode number out of range.
171                   Dot or dot-dot not the first two entries of  a
172                   directory or having the wrong inode number.
173       8.    Super Block checks:
174                   More  blocks  for inodes than there are in the
175                   file system.
176       9.    Bad free block map format.
177       10.   Total free block and/or free inode count  incorrect.
178
179       Orphaned    files    and    directories   (allocated   but
180       unreferenced)  are,  with  the   operator's   concurrence,
181       reconnected  by  placing them in the lloosstt++ffoouunndd directory.
182       The name assigned is the inode number.  If the  _l_o_s_t+_f_o_u_n_d
183       directory  does  not  exist,  it  is created.  If there is
184       insufficient space its size is increased.
185
186       Because of inconsistencies between the  block  device  and
187       the buffer cache, the raw device should always be used.
188
189FFIILLEESS
190       /etc/fstab           contains default list of file systems
191                            to check.
192
193
194
195
19620,                           April                             3
197
198
199
200
201
202FSCK(8)                        1991                       FSCK(8)
203
204
205DDIIAAGGNNOOSSTTIICCSS
206       The diagnostics produced by _f_s_c_k are fully enumerated  and
207       explained  in  Appendix A of ``Fsck - The UNIX File System
208       Check Program'' (SMM:5).
209
210SSEEEE AALLSSOO
211       fstab(5), fs(5), fsdb(8), newfs(8), mkfs(8), reboot(8)
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
26220,                           April                             4
263
264
265