FSCK_EXT2FS(8) | System Manager's Manual | FSCK_EXT2FS(8) |
fsck_ext2fs
—
fsck_ext2fs |
[-dfnpUy ] [-b
block#] [-m
mode] filesystem ... |
fsck_ext2fs
performs interactive filesystem consistency
checks and repair for each of the filesystems specified on the command line.
It is normally invoked from
fsck(8).
The kernel takes care that only a restricted class of innocuous filesystem inconsistencies can happen unless hardware or software failures intervene. These are limited to the following:
These are the only inconsistencies that
fsck_ext2fs
in “preen” mode (with the
-p
option) will correct; if it encounters other
inconsistencies, it exits with an abnormal return status. For each corrected
inconsistency one or more lines will be printed identifying the filesystem
on which the correction will take place, and the nature of the correction.
After successfully correcting a filesystem,
fsck_ext2fs
will print the number of files on that
filesystem and the number of used and free blocks.
If sent a QUIT
signal,
fsck_ext2fs
will finish the filesystem checks, then
exit with an abnormal return status.
Without the -p
option,
fsck_ext2fs
audits and interactively repairs
inconsistent conditions for filesystems. If the filesystem is inconsistent
the operator is prompted for concurrence before each correction is
attempted. It should be noted that some of the corrective actions which are
not correctable under the -p
option will result in
some loss of data. The amount and severity of data lost may be determined
from the diagnostic output. The default action for each consistency
correction is to wait for the operator to respond
yes
or no
. If the operator
does not have write permission on the filesystem
fsck_ext2fs
will default to a
-n
action.
The following flags are interpreted by
fsck_ext2fs
.
-b
-d
-f
fsck_ext2fs
will not check
the file system. This option forces fsck_ext2fs
to
check the file system, regardless of the state of the clean flag.-m
-n
fsck_ext2fs
except for
‘CONTINUE?
’, which is assumed to be
affirmative; do not open the filesystem for writing.-p
-U
-y
fsck_ext2fs
; this should be used with great
caution as this is a free license to continue after essentially unlimited
trouble has been encountered.Inconsistencies checked are as follows:
Orphaned files and directories (allocated but unreferenced) are, with the operator's concurrence, reconnected by placing them in the lost+found directory. The name assigned is the inode number. If the lost+found directory does not exist, it is created. If there is insufficient space its size is increased.
Because of inconsistencies between the block device and the buffer cache, the raw device should always be used.
fsck_ext2fs
are fully
enumerated and explained in Appendix A of
Fsck - The UNIX File System Check
Program.
fsck_ext2fs
utility appeared in
NetBSD 1.3.
fsck_ext2fs
was written by Manuel
Bouyer
<bouyer@NetBSD.org>.
August 27, 2018 | NetBSD 9.4 |