Sun Microsystems Sun Workstation 100U System Manager's Manual page 296

Table of Contents

Advertisement

Fsck - The
UNIX
File System Check Program
When a UNIX operating system is brought up, a consistency check of the file systems should
always be performed. This precautionary measure helps to insure a reliable environment for file
storage on disk. If an inconsistency is discovered, corrective action must be taken.
F,ck
runs
in two modes. Normally it is run non-interactively by the system after a normal boot. When
running in this mode, it will only make changes to the file system that are known to always be
correct. If an unexpected inconsistency is found
/,ck
will exit with a non-zero exit status, leav-
ing the system running single-user. Typically the operator then runs
/,ck
interactively. When
running in this mode, each problem is listed followed by a suggested corrective action. The
operator must decide whether or not the suggested correction should be made.
The purpose of this memo is to dispel the mystique surrounding file system inconsistencies. It
first describes the updating of the file system (the calm before the storm) and then describes file
system corruption (the storm). Finally, the set of deterministic corrective actions used by
/,ck
(the Coast Guard to the rescue) is presented.
1. Overview
or
the File System
The file system is discussed in detail in [Mckusick83]; this section gives a brief overview.
1.1. Superblock
A
file system is described by its ,uper-block. The super-block is built when the file system is
created (see new/,,(8)) and never changes. The super-block contains the basic parameters of the
file system, such as the number of data blocks it contains and a count of the maximum number
of files. Because the super-block contains critical data,
new/,
replicates it to protect against
catastrophic loss. The default ,uper block always resides at a fixed offset from the beginning of
the file system's disk partition. The redundant ,uper block, are not referenced unless a head
crash or other hard disk error causes the default super-block to be unusable. The redundant
blocks are sprinkled throughout the disk partition.
Within the file system are files. Certain files are distinguished as directories and contain collec-
tions of pointers to files that may themselves
be
directories. Every file has a descriptor associ-
ated with it called an inode. The inode contains information describing ownership of the file,
time stamps indicating modification and access times for the file, and an array of indices point-
ing to the data blocks for the file. In this section, we assume that the first 12 blocks of the file
This document reflects the use or lIck with tbe revised file system organization implemented in
release 0.1 or the Sun UNIX operating system. This is a revision or the original paper written
by
T.
J.
Kowalski.
28 July 1983
1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sun workstation 150u

Table of Contents