xref: /freebsd/sbin/fsck_ffs/fsck_ffs.8 (revision 1a720cbec513210fa2e85c3882741ef2f6dc5f35)
1d33e92f9SJulian Elischer.\"
28fae3551SRodney W. Grimes.\" Copyright (c) 1980, 1989, 1991, 1993
38fae3551SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
48fae3551SRodney W. Grimes.\"
58fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
68fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions
78fae3551SRodney W. Grimes.\" are met:
88fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
98fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
108fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
118fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
128fae3551SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
13fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
148fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
158fae3551SRodney W. Grimes.\"    without specific prior written permission.
168fae3551SRodney W. Grimes.\"
178fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
188fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
198fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
208fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
218fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
228fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
238fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
248fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
258fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
268fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
278fae3551SRodney W. Grimes.\" SUCH DAMAGE.
288fae3551SRodney W. Grimes.\"
29115459beSGordon Bergling.Dd November 17, 2023
308684bec0SNik Clayton.Dt FSCK_FFS 8
31f8923543SRuslan Ermilov.Os
328fae3551SRodney W. Grimes.Sh NAME
338684bec0SNik Clayton.Nm fsck_ffs ,
348684bec0SNik Clayton.Nm fsck_ufs
358fae3551SRodney W. Grimes.Nd file system consistency check and interactive repair
368fae3551SRodney W. Grimes.Sh SYNOPSIS
377c7fb079SRuslan Ermilov.Nm
380061238fSKirk McKusick.Op Fl BCdEFfnpRrSyZz
398d646af5SRuslan Ermilov.Op Fl b Ar block
408fae3551SRodney W. Grimes.Op Fl c Ar level
418fae3551SRodney W. Grimes.Op Fl m Ar mode
4215fca934SKirk McKusick.Ar filesystem
438fae3551SRodney W. Grimes.Ar ...
448fae3551SRodney W. Grimes.Sh DESCRIPTION
4515fca934SKirk McKusickThe specified disk partitions and/or file systems are checked.
46111a5220SDavid E. O'BrienIn "preen" or "check clean" mode the clean flag of each file system's
47111a5220SDavid E. O'Briensuperblock is examined and only those file systems that are not marked clean
48111a5220SDavid E. O'Brienare checked.
49780a5c1eSPeter WemmFile systems are marked clean when they are unmounted,
50780a5c1eSPeter Wemmwhen they have been mounted read-only, or when
516b100474SJulian Elischer.Nm
52780a5c1eSPeter Wemmruns on them successfully.
536b100474SJulian ElischerIf the
546b100474SJulian Elischer.Fl f
556b100474SJulian Elischeroption is specified, the file systems
566b100474SJulian Elischerwill be checked regardless of the state of their clean flag.
5741cee58cSDavid Greenman.Pp
588fae3551SRodney W. GrimesThe kernel takes care that only a restricted class of innocuous file system
598fae3551SRodney W. Grimesinconsistencies can happen unless hardware or software failures intervene.
608fae3551SRodney W. GrimesThese are limited to the following:
61d33e92f9SJulian Elischer.Pp
62d33e92f9SJulian Elischer.Bl -item -compact -offset indent
638fae3551SRodney W. Grimes.It
648fae3551SRodney W. GrimesUnreferenced inodes
658fae3551SRodney W. Grimes.It
668fae3551SRodney W. GrimesLink counts in inodes too large
678fae3551SRodney W. Grimes.It
688fae3551SRodney W. GrimesMissing blocks in the free map
698fae3551SRodney W. Grimes.It
708fae3551SRodney W. GrimesBlocks in the free map also in files
718fae3551SRodney W. Grimes.It
728fae3551SRodney W. GrimesCounts in the super-block wrong
738fae3551SRodney W. Grimes.El
748fae3551SRodney W. Grimes.Pp
758fae3551SRodney W. GrimesThese are the only inconsistencies that
766b100474SJulian Elischer.Nm
778fae3551SRodney W. Grimeswith the
788fae3551SRodney W. Grimes.Fl p
798fae3551SRodney W. Grimesoption will correct; if it encounters other inconsistencies, it exits
808fae3551SRodney W. Grimeswith an abnormal return status and an automatic reboot will then fail.
818fae3551SRodney W. GrimesFor each corrected inconsistency one or more lines will be printed
828fae3551SRodney W. Grimesidentifying the file system on which the correction will take place,
839806e231SRuslan Ermilovand the nature of the correction.
849806e231SRuslan ErmilovAfter successfully correcting a file system,
856b100474SJulian Elischer.Nm
868fae3551SRodney W. Grimeswill print the number of files on that file system,
878fae3551SRodney W. Grimesthe number of used and free blocks,
888fae3551SRodney W. Grimesand the percentage of fragmentation.
898fae3551SRodney W. Grimes.Pp
908fae3551SRodney W. GrimesIf sent a
918fae3551SRodney W. Grimes.Dv QUIT
928fae3551SRodney W. Grimessignal,
936b100474SJulian Elischer.Nm
948fae3551SRodney W. Grimeswill finish the file system checks, then exit with an abnormal
958fae3551SRodney W. Grimesreturn status that causes an automatic reboot to fail.
968fae3551SRodney W. GrimesThis is useful when you want to finish the file system checks during an
978fae3551SRodney W. Grimesautomatic reboot,
988fae3551SRodney W. Grimesbut do not want the machine to come up multiuser after the checks complete.
998fae3551SRodney W. Grimes.Pp
100fefd74d8SIan DowseIf
101fefd74d8SIan Dowse.Nm
102fefd74d8SIan Dowsereceives a
103fefd74d8SIan Dowse.Dv SIGINFO
104fefd74d8SIan Dowse(see the
105fefd74d8SIan Dowse.Dq status
106fefd74d8SIan Dowseargument for
107fefd74d8SIan Dowse.Xr stty 1 )
108fefd74d8SIan Dowsesignal, a line will be written to the standard output indicating
109fefd74d8SIan Dowsethe name of the device currently being checked, the current phase
110fefd74d8SIan Dowsenumber and phase-specific progress information.
111fefd74d8SIan Dowse.Pp
1128fae3551SRodney W. GrimesWithout the
1138fae3551SRodney W. Grimes.Fl p
1148fae3551SRodney W. Grimesoption,
1156b100474SJulian Elischer.Nm
1168fae3551SRodney W. Grimesaudits and interactively repairs inconsistent conditions for file systems.
1178fae3551SRodney W. GrimesIf the file system is inconsistent the operator is prompted for concurrence
1188fae3551SRodney W. Grimesbefore each correction is attempted.
1198fae3551SRodney W. GrimesIt should be noted that some of the corrective actions which are not
1208fae3551SRodney W. Grimescorrectable under the
1218fae3551SRodney W. Grimes.Fl p
1228fae3551SRodney W. Grimesoption will result in some loss of data.
1238fae3551SRodney W. GrimesThe amount and severity of data lost may be determined from the diagnostic
1248fae3551SRodney W. Grimesoutput.
1258fae3551SRodney W. GrimesThe default action for each consistency correction
1268fae3551SRodney W. Grimesis to wait for the operator to respond
1278fae3551SRodney W. Grimes.Li yes
1288fae3551SRodney W. Grimesor
1298fae3551SRodney W. Grimes.Li no .
1308fae3551SRodney W. GrimesIf the operator does not have write permission on the file system
1316b100474SJulian Elischer.Nm
1328fae3551SRodney W. Grimeswill default to a
1338fae3551SRodney W. Grimes.Fl n
1348fae3551SRodney W. Grimesaction.
1358fae3551SRodney W. Grimes.Pp
1368fae3551SRodney W. GrimesThe following flags are interpreted by
137f8923543SRuslan Ermilov.Nm :
1388fae3551SRodney W. Grimes.Bl -tag -width indent
139af18c835SDag-Erling Smørgrav.It Fl B
140af18c835SDag-Erling SmørgravA check is done on the specified and possibly active file system.
141af18c835SDag-Erling SmørgravThe set of corrections that can be done is limited to those done
142af18c835SDag-Erling Smørgravwhen running in preen mode (see the
143dc069d64SDag-Erling Smørgrav.Fl p
144dc069d64SDag-Erling Smørgravflag).
145dc069d64SDag-Erling SmørgravIf unexpected errors are found,
146dc069d64SDag-Erling Smørgravthe file system is marked as needing a foreground check and
147dc069d64SDag-Erling Smørgrav.Nm
148dc069d64SDag-Erling Smørgravexits without attempting any further cleaning.
1498fae3551SRodney W. Grimes.It Fl b
1508fae3551SRodney W. GrimesUse the block specified immediately after the flag as
1519806e231SRuslan Ermilovthe super block for the file system.
152d80980c8SXin LIAn alternate super block is usually located at block 32 for UFS1,
15347d3e2f8SKirk McKusickand block 192 for UFS2.
15492858a92SEdward Tomasz Napierala.Pp
15592858a92SEdward Tomasz NapieralaSee the
15692858a92SEdward Tomasz Napierala.Fl N
15792858a92SEdward Tomasz Napieralaflag of
15892858a92SEdward Tomasz Napierala.Xr newfs 8 .
159111a5220SDavid E. O'Brien.It Fl C
160f6ac2391SJoel DahlCheck if file system was dismounted cleanly.
161111a5220SDavid E. O'BrienIf so, skip file system checks (like "preen").
162111a5220SDavid E. O'BrienHowever, if the file system was not cleanly dismounted, do full checks,
163c2025a76SJoel Dahlas if
164111a5220SDavid E. O'Brien.Nm
165111a5220SDavid E. O'Brienwas invoked without
166111a5220SDavid E. O'Brien.Fl C .
1678fae3551SRodney W. Grimes.It Fl c
1688fae3551SRodney W. GrimesConvert the file system to the specified level.
1698fae3551SRodney W. GrimesNote that the level of a file system can only be raised.
170780a5c1eSPeter WemmThere are currently four levels defined:
1717df8ffa1SRuslan Ermilov.Bl -tag -width indent
1728fae3551SRodney W. Grimes.It 0
1738fae3551SRodney W. GrimesThe file system is in the old (static table) format.
1748fae3551SRodney W. Grimes.It 1
1758fae3551SRodney W. GrimesThe file system is in the new (dynamic table) format.
1768fae3551SRodney W. Grimes.It 2
1778fae3551SRodney W. GrimesThe file system supports 32-bit uid's and gid's,
1788fae3551SRodney W. Grimesshort symbolic links are stored in the inode,
1798fae3551SRodney W. Grimesand directories have an added field showing the file type.
180780a5c1eSPeter Wemm.It 3
181780a5c1eSPeter WemmIf maxcontig is greater than one,
182780a5c1eSPeter Wemmbuild the free segment maps to aid in finding contiguous sets of blocks.
183780a5c1eSPeter WemmIf maxcontig is equal to one, delete any existing segment maps.
1848fae3551SRodney W. Grimes.El
1858fae3551SRodney W. Grimes.Pp
1868fae3551SRodney W. GrimesIn interactive mode,
1876b100474SJulian Elischer.Nm
1888fae3551SRodney W. Grimeswill list the conversion to be made
1898fae3551SRodney W. Grimesand ask whether the conversion should be done.
1908fae3551SRodney W. GrimesIf a negative answer is given,
1918fae3551SRodney W. Grimesno further operations are done on the file system.
1928fae3551SRodney W. GrimesIn preen mode,
1938fae3551SRodney W. Grimesthe conversion is listed and done if
1948fae3551SRodney W. Grimespossible without user interaction.
1958fae3551SRodney W. GrimesConversion in preen mode is best used when all the file systems
1968fae3551SRodney W. Grimesare being converted at once.
1978fae3551SRodney W. GrimesThe format of a file system can be determined from the
1988fae3551SRodney W. Grimesfirst line of output from
1998fae3551SRodney W. Grimes.Xr dumpfs 8 .
2007f94ca72SXin LI.Pp
2017f94ca72SXin LIThis option implies the
2027f94ca72SXin LI.Fl f
2037f94ca72SXin LIflag.
204db83b143SRenato Botelho.It Fl d
205db83b143SRenato BotelhoEnable debugging messages.
206db83b143SRenato Botelho.It Fl E
207db83b143SRenato BotelhoClear unallocated blocks, notifying the underlying device that they
208db83b143SRenato Botelhoare not used and that their contents may be discarded.
209db83b143SRenato BotelhoThis is useful for filesystems which have been mounted on systems
210db83b143SRenato Botelhowithout TRIM support, or with TRIM support disabled, as well as
211db83b143SRenato Botelhofilesystems which have been copied from one device to another.
212db83b143SRenato Botelho.Pp
213db83b143SRenato BotelhoSee the
214db83b143SRenato Botelho.Fl E
215db83b143SRenato Botelhoand
216db83b143SRenato Botelho.Fl t
217db83b143SRenato Botelhoflags of
218db83b143SRenato Botelho.Xr newfs 8 ,
219db83b143SRenato Botelhoand
220db83b143SRenato Botelhothe
221db83b143SRenato Botelho.Fl t
222db83b143SRenato Botelhoflag of
223db83b143SRenato Botelho.Xr tunefs 8 .
224db83b143SRenato Botelho.It Fl F
225db83b143SRenato BotelhoDetermine whether the file system needs to be cleaned immediately
226db83b143SRenato Botelhoin foreground, or if its cleaning can be deferred to background.
227db83b143SRenato BotelhoTo be eligible for background cleaning it must have been running
228db83b143SRenato Botelhowith soft updates, not have been marked as needing a foreground check,
229db83b143SRenato Botelhoand be mounted and writable when the background check is to be done.
230db83b143SRenato BotelhoIf these conditions are met, then
231db83b143SRenato Botelho.Nm
232db83b143SRenato Botelhoexits with a zero exit status.
233db83b143SRenato BotelhoOtherwise it exits with a non-zero exit status.
234db83b143SRenato BotelhoIf the file system is clean,
235db83b143SRenato Botelhoit will exit with a non-zero exit status so that the clean status
236db83b143SRenato Botelhoof the file system can be verified and reported during the foreground
237db83b143SRenato Botelhochecks.
238db83b143SRenato BotelhoNote that when invoked with the
239db83b143SRenato Botelho.Fl F
240db83b143SRenato Botelhoflag, no cleanups are done.
241db83b143SRenato BotelhoThe only thing that
242db83b143SRenato Botelho.Nm
243db83b143SRenato Botelhodoes is to determine whether a foreground or background
244db83b143SRenato Botelhocheck is needed and exit with an appropriate status code.
245d33e92f9SJulian Elischer.It Fl f
246d33e92f9SJulian ElischerForce
2477c7fb079SRuslan Ermilov.Nm
248d33e92f9SJulian Elischerto check
249d33e92f9SJulian Elischer.Sq clean
250d33e92f9SJulian Elischerfile systems when preening.
251d33e92f9SJulian Elischer.It Fl m
252d33e92f9SJulian ElischerUse the mode specified in octal immediately after the flag as the
253d33e92f9SJulian Elischerpermission bits to use when creating the
254d33e92f9SJulian Elischer.Pa lost+found
255d33e92f9SJulian Elischerdirectory rather than the default 1777.
256d33e92f9SJulian ElischerIn particular, systems that do not wish to have lost files accessible
257d33e92f9SJulian Elischerby all users on the system should use a more restrictive
258d33e92f9SJulian Elischerset of permissions such as 700.
259d33e92f9SJulian Elischer.It Fl n
260d33e92f9SJulian ElischerAssume a no response to all questions asked by
2616b100474SJulian Elischer.Nm
262d33e92f9SJulian Elischerexcept for
263d33e92f9SJulian Elischer.Ql CONTINUE? ,
264d33e92f9SJulian Elischerwhich is assumed to be affirmative;
265d33e92f9SJulian Elischerdo not open the file system for writing.
266d33e92f9SJulian Elischer.It Fl p
267d33e92f9SJulian ElischerPreen file systems (see above).
2687703a6ffSScott Long.It Fl R
2697703a6ffSScott LongInstruct fsck_ffs to restart itself if it encounters certain errors that
270ac52fd7fSSevan Janiyanwarrant another run.
271ac52fd7fSSevan JaniyanIt will limit itself to a maximum of 10 restarts in a given run in order
272ac52fd7fSSevan Janiyanto avoid an endless loop with extremely corrupted filesystems.
273910b491eSKirk McKusick.It Fl r
274910b491eSKirk McKusickFree up excess unused inodes.
275910b491eSKirk McKusickDecreasing the number of preallocated inodes reduces the
276910b491eSKirk McKusickrunning time of future runs of
277910b491eSKirk McKusick.Nm
278910b491eSKirk McKusickand frees up space that can allocated to files.
279910b491eSKirk McKusickThe
280910b491eSKirk McKusick.Fl r
281910b491eSKirk McKusickoption is ignored when running in preen mode.
28280d5f59dSScott Long.It Fl S
28380d5f59dSScott LongSurrender on error.
28480d5f59dSScott LongWith this flag enabled, a hard error returned on disk i/o will cause
28580d5f59dSScott Long.Nm
28680d5f59dSScott Longto abort instead of continuing on and possibly tripping over more i/o errors.
287d33e92f9SJulian Elischer.It Fl y
288d33e92f9SJulian ElischerAssume a yes response to all questions asked by
2897c7fb079SRuslan Ermilov.Nm ;
290d33e92f9SJulian Elischerthis should be used with great caution as this is a free license
291d33e92f9SJulian Elischerto continue after essentially unlimited trouble has been encountered.
2922b5373deSDag-Erling Smørgrav.It Fl Z
2932b5373deSDag-Erling SmørgravSimilar to
2942b5373deSDag-Erling Smørgrav.Fl E ,
2952b5373deSDag-Erling Smørgravbut overwrites unused blocks with zeroes.
2962b5373deSDag-Erling SmørgravIf both
2972b5373deSDag-Erling Smørgrav.Fl E
2982b5373deSDag-Erling Smørgravand
2992b5373deSDag-Erling Smørgrav.Fl Z
3002b5373deSDag-Erling Smørgravare specified, blocks are first zeroed and then erased.
3010061238fSKirk McKusick.It Fl z
3020061238fSKirk McKusickClear unused directory space.
3030061238fSKirk McKusickThe cleared space includes deleted file names and name padding.
3048fae3551SRodney W. Grimes.El
3058fae3551SRodney W. Grimes.Pp
3068fae3551SRodney W. GrimesInconsistencies checked are as follows:
3071252c1bbSRuslan Ermilov.Pp
3081252c1bbSRuslan Ermilov.Bl -enum -compact
3098fae3551SRodney W. Grimes.It
3108fae3551SRodney W. GrimesBlocks claimed by more than one inode or the free map.
3118fae3551SRodney W. Grimes.It
3128fae3551SRodney W. GrimesBlocks claimed by an inode outside the range of the file system.
3138fae3551SRodney W. Grimes.It
3148fae3551SRodney W. GrimesIncorrect link counts.
3158fae3551SRodney W. Grimes.It
3168fae3551SRodney W. GrimesSize checks:
3171252c1bbSRuslan Ermilov.Bl -item -offset indent -compact
3188fae3551SRodney W. Grimes.It
3198fae3551SRodney W. GrimesDirectory size not a multiple of DIRBLKSIZ.
3208fae3551SRodney W. Grimes.It
3218fae3551SRodney W. GrimesPartially truncated file.
3228fae3551SRodney W. Grimes.El
3238fae3551SRodney W. Grimes.It
3248fae3551SRodney W. GrimesBad inode format.
3258fae3551SRodney W. Grimes.It
3268fae3551SRodney W. GrimesBlocks not accounted for anywhere.
3278fae3551SRodney W. Grimes.It
3288fae3551SRodney W. GrimesDirectory checks:
3291252c1bbSRuslan Ermilov.Bl -item -offset indent -compact
3308fae3551SRodney W. Grimes.It
3318fae3551SRodney W. GrimesFile pointing to unallocated inode.
3328fae3551SRodney W. Grimes.It
3338fae3551SRodney W. GrimesInode number out of range.
3348fae3551SRodney W. Grimes.It
335d33e92f9SJulian ElischerDirectories with unallocated blocks (holes).
33647ceb636SGuido van Rooij.It
3378fae3551SRodney W. GrimesDot or dot-dot not the first two entries of a directory
3388fae3551SRodney W. Grimesor having the wrong inode number.
3398fae3551SRodney W. Grimes.El
3408fae3551SRodney W. Grimes.It
3418fae3551SRodney W. GrimesSuper Block checks:
3421252c1bbSRuslan Ermilov.Bl -item -offset indent -compact
3438fae3551SRodney W. Grimes.It
3448fae3551SRodney W. GrimesMore blocks for inodes than there are in the file system.
3458fae3551SRodney W. Grimes.It
3468fae3551SRodney W. GrimesBad free block map format.
3478fae3551SRodney W. Grimes.It
3488fae3551SRodney W. GrimesTotal free block and/or free inode count incorrect.
3498fae3551SRodney W. Grimes.El
3508fae3551SRodney W. Grimes.El
3518fae3551SRodney W. Grimes.Pp
3528fae3551SRodney W. GrimesOrphaned files and directories (allocated but unreferenced) are,
3538fae3551SRodney W. Grimeswith the operator's concurrence, reconnected by
3548fae3551SRodney W. Grimesplacing them in the
3558fae3551SRodney W. Grimes.Pa lost+found
3568fae3551SRodney W. Grimesdirectory.
3578fae3551SRodney W. GrimesThe name assigned is the inode number.
3588fae3551SRodney W. GrimesIf the
3598fae3551SRodney W. Grimes.Pa lost+found
3608fae3551SRodney W. Grimesdirectory does not exist, it is created.
3618fae3551SRodney W. GrimesIf there is insufficient space its size is increased.
3625ee561eeSKirk McKusick.Pp
3635ee561eeSKirk McKusickThe full foreground
3645ee561eeSKirk McKusick.Nm
3655ee561eeSKirk McKusickchecks for many more problems that may occur after an
3665ee561eeSKirk McKusickunrecoverable disk write error.
3675ee561eeSKirk McKusickThus, it is recommended that you perform foreground
3685ee561eeSKirk McKusick.Nm
3695ee561eeSKirk McKusickon your systems periodically and whenever you encounter
3705ee561eeSKirk McKusickunrecoverable disk write errors or file-system\-related panics.
3718fae3551SRodney W. Grimes.Sh FILES
3728fae3551SRodney W. Grimes.Bl -tag -width /etc/fstab -compact
3738fae3551SRodney W. Grimes.It Pa /etc/fstab
3748fae3551SRodney W. Grimescontains default list of file systems to check.
3758fae3551SRodney W. Grimes.El
376a866e170SRuslan Ermilov.Sh EXIT STATUS
377830a9d77SRuslan Ermilov.Ex -std
3786f5c4436SRemko Lodder.Pp
379469759f8SDavid BrightSpecific non-zero exit status values used are:
380469759f8SDavid Bright.Bl -tag -width indent
381469759f8SDavid Bright.It 1
382469759f8SDavid BrightUsage error (missing or invalid command arguments).
383469759f8SDavid Bright.It 2
384469759f8SDavid BrightThe
385469759f8SDavid Bright.Fl p
386469759f8SDavid Brightoption was used and a
387469759f8SDavid Bright.Dv SIGQUIT
388469759f8SDavid Brightwas received, indicating that the system should be returned to single
389469759f8SDavid Brightuser mode after the file system check.
390469759f8SDavid Bright.It 3
391469759f8SDavid BrightThe file system superblock cannot be read.
392469759f8SDavid BrightThis could indicate that the file system device does not exist or is not yet
393469759f8SDavid Brightready.
394469759f8SDavid Bright.It 4
395469759f8SDavid BrightA mounted file system was modified; the system should be rebooted.
396469759f8SDavid Bright.It 5
397469759f8SDavid BrightThe
398469759f8SDavid Bright.Fl B
399469759f8SDavid Brightoption was used and soft updates are not enabled on the file system.
400469759f8SDavid Bright.It 6
401469759f8SDavid BrightThe
402469759f8SDavid Bright.Fl B
403469759f8SDavid Brightoption was used and the kernel lacks needed support.
404469759f8SDavid Bright.It 7
405469759f8SDavid BrightThe
4066f5c4436SRemko Lodder.Fl F
407469759f8SDavid Brightoption was used and the file system is clean.
408469759f8SDavid Bright.It 8
409469759f8SDavid BrightGeneral error exit.
410469759f8SDavid Bright.It 16
411469759f8SDavid BrightThe file system could not be completely repaired.
412469759f8SDavid BrightThe file system may be able to be repaired by running
4136f5c4436SRemko Lodder.Nm
414469759f8SDavid Brighton the file system again.
415469759f8SDavid Bright.El
416a866e170SRuslan Ermilov.Sh DIAGNOSTICS
4178fae3551SRodney W. GrimesThe diagnostics produced by
4186b100474SJulian Elischer.Nm
4198fae3551SRodney W. Grimesare fully enumerated and explained in Appendix A of
4208fae3551SRodney W. Grimes.Rs
4218fae3551SRodney W. Grimes.%T "Fsck \- The UNIX File System Check Program"
4228fae3551SRodney W. Grimes.Re
4238fae3551SRodney W. Grimes.Sh SEE ALSO
424*1a720cbeSAlexander Ziaee.Xr ffs 4 ,
425d33e92f9SJulian Elischer.Xr fs 5 ,
4266b100474SJulian Elischer.Xr fstab 5 ,
4278684bec0SNik Clayton.Xr fsck 8 ,
4286b100474SJulian Elischer.Xr fsdb 8 ,
4298fae3551SRodney W. Grimes.Xr newfs 8 ,
4308fae3551SRodney W. Grimes.Xr reboot 8
431ac52fd7fSSevan Janiyan.Sh HISTORY
432ac52fd7fSSevan JaniyanA
433ac52fd7fSSevan Janiyan.Nm fsck
434ac52fd7fSSevan Janiyanutility appeared in
435ac52fd7fSSevan Janiyan.Bx 4.0 .
436ac52fd7fSSevan JaniyanIt became
437ac52fd7fSSevan Janiyan.Nm
438ac52fd7fSSevan Janiyanin
439ac52fd7fSSevan Janiyan.Fx 5.0
440ac52fd7fSSevan Janiyanwith the introduction of the filesystem independent wrapper as
441ac52fd7fSSevan Janiyan.Nm fsck .
442