FSCK.FFS(1M) RISC/os Reference Manual FSCK.FFS(1M)
NAME
fsck.ffs - filesystem consistency check and interactive
repair
SYNOPSIS
/etc/fsck.ffs -p [ other options ] [ filesystem ]
/etc/fsck.ffs -a [ other options ] [ filesystem ]
/etc/fsck.ffs [ other options ] [ -y ] [ -n ] [ filesystem ]
DESCRIPTION
The first form of fsck.ffs preens a standard set of filesys-
tems or the specified filesystems. It is normally used in
the script /etc/mountall during automatic reboot. In this
case fsck.ffs reads the table /etc/fstab to determine which
filesystems to check. It uses the information there to
inspect groups of disks in parallel taking maximum advantage
of I/O overlap to check the filesystems as quickly as possi-
ble. The second form is identical to the first except the
root filesystem is not checked. Normally on a MIPS machine,
the root filesystem will be checked on pass 1 and all others
are checked on pass 2. Slower machines in the past would
check the root filesystem on pass 1, other ``root'' (``a''
partition) filesystems on pass 2, other small filesystems on
separate passes (e.g. the ``d'' filesystems on pass 3 and
the ``e'' filesystems on pass 4), and finally the large user
filesystems on the last pass, e.g. pass 5. See fstab(4) for
more information.
Only partitions in fstab that are mounted rw or rq and that
have non-zero pass number are checked.
The system takes care that only a restricted class of inno-
cuous inconsistencies can happen unless hardware or software
failures intervene. These are limited to the following:
Unreferenced inodes
Link counts in inodes too large
Missing blocks in the free list
Blocks in the free list also in files
Counts in the super-block wrong
These are the only inconsistencies that fsck.ffs with the -p
option will correct; if it encounters other inconsistencies,
it exits with an abnormal return status and an automatic
reboot will then fail. 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 file system,
Printed 11/19/92 Page 1
FSCK.FFS(1M) RISC/os Reference Manual FSCK.FFS(1M)
fsck.ffs will print the number of files on that filesystem,
the number of used and free blocks, and the percentage of
fragmentation.
If sent a QUIT signal, fsck.ffs will finish the filesystem
checks, then exit with an abnormal return status that on
vanilla BSD machines causes the automatic reboot to fail.
This is useful when you wish to finish the filesystem
checks, but do not want the machine to come up multiuser.
However, when booting RISC/os, the QUIT signal cannot be
sent to fsck.ffs during the boot sequence. Hence, this
option is not available.
Without the -p option, fsck.ffs audits and interactively
repairs inconsistent conditions for filesystems. If the
filesystem is inconsistent the operator is prompted for con-
currence 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 deter-
mined 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 per-
mission on the filesystem fsck.ffs will default to a -n
action.
fsck.ffs has more consistency checks than its predecessors
check, dcheck, fcheck, and icheck combined.
The following flags are interpreted by fsck.ffs.
-b Use the block specified immediately after the flag as
the super block for the filesystem. Block 32 is always
an alternate super block.
-y Assume a yes response to all questions asked by
fsck.ffs; this should be used with great caution as
this is a free license to continue after essentially
unlimited trouble has been encountered.
-n Assume a no response to all questions asked by
fsck.ffs; do not open the filesystem for writing.
-d Print additional debug information about corrections
taking place.
-r Normally, fsck.ffs will remount root after checking it;
however, this flag will force a reboot of the system.
-C Check only dirty filesystems by looking at the return
value of fsstat(1M).
Page 2 Printed 11/19/92
FSCK.FFS(1M) RISC/os Reference Manual FSCK.FFS(1M)
If no filesystems are given to fsck.ffs then a default list
of filesystems is read from the file /etc/fstab.
Inconsistencies checked are as follows:
1. Blocks claimed by more than one inode or the free list.
2. Blocks claimed by an inode or the free list outside the
range of the filesystem.
3. Incorrect link counts.
4. Size checks:
Directory size not of proper format.
5. Bad inode format.
6. Blocks not accounted for anywhere.
7. Directory checks:
File pointing to unallocated inode.
Inode number out of range.
8. Super Block checks:
More blocks for inodes than there are in the
filesystem.
9. Bad free block list format.
10. Total free block and/or free inode count incorrect.
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.
Checking the raw device is almost always faster.
FILES
/etc/fstab contains default list of filesystems to
check.
DIAGNOSTICS
The diagnostics produced by fsck.ffs are fully enumerated
and explained in Appendix B of the System Administrator's
Guide.
SEE ALSO
crash(1M), fsck(1M), mkfs.ffs(1M), newfs.ffs(1M).
fs.ffs(4), fstab(4) in the Programmer's Reference Manual.
CAVEATS
There should be some way to start a fsck.ffs -p at pass n.
WARNING
fsck.ffs reboots itself after executing checking the root
partition if it thinks the reboot is necessary. This
prevents possible disk corruption if fsck.ffs changes the
root filesystem. Normally, fsck.ffs will automatically
Printed 11/19/92 Page 3
FSCK.FFS(1M) RISC/os Reference Manual FSCK.FFS(1M)
remount root.
Page 4 Printed 11/19/92