fsck(1M) DG/UX 5.4 Rel. 2.01 fsck(1M)
NAME
fsck - check file systems for consistency and repair them
SYNOPSIS
/sbin/fsck [-l] [-p] [-q] [-y] [-n] [-r] [-x] [ special ... ]
DESCRIPTION
Fsck checks file systems and corrects inconsistencies. special is
the pathname of a special file referring to a device containing a
file system; the default is the standard set of special files listed
in /etc/checklist. If no /etc/checklist exists, /etc/fstab is used.
If you wish to check several file systems at once, omit special and
specify the -p option. The /etc/fstab file contains a pass number
and a mounting status for each file system. When using this file,
fsck checks only those file systems that have a non-zero pass number
and a "rw" or "ro" mounting status. The order of file system
checking is based on pass number, starting at 1.
To save time, have fsck check file systems on disks run by different
controllers on the same pass. To do this, make the pass number for
each of these file systems the same in /etc/fstab.
Invoking the fsck Program
There are two ways that fsck is invoked:
Startup script This is the most common way of invoking fsck.
When you are in multi-user mode bringing up the
system with the init command, you can
automatically execute fsck from within your
startup script.
Command line From the command line, you type: fsck [options]
[filesystemnames].
Options
All options except for -t are boolean flags, and may thus be
combined: fsck -pxl, for example. The following options are
interpreted by fsck:
-l Perform fast recovery from the fsck log, if possible. Fast
recovery can be performed only if the fsck_log_size option,
which turns on fast recovery logging, was used the last time
the file system was mounted and this is the first time that fsck
has been run on the file system since that mount. If fast
recovery cannot be performed on the file system, normal recovery
will be.
Normal recovery causes the entire file system to be scanned
during the consistency check. Fast recovery makes use of a log
created while the system is running and the file system is
mounted that details file system changes. By performing the
consistency check only on the parts of the file system known to
have changed, fsck in fast recovery mode runs in time
Licensed material--property of copyright holder(s) 1
fsck(1M) DG/UX 5.4 Rel. 2.01 fsck(1M)
proportional to the size of the fsck log rather than to the size
of the file system.
-p Detect all possible inconsistencies, but correct only those
inconsistencies that may be expected to occur from an abnormal
system halt. For each corrected inconsistency, one or more
lines will be printed identifying the file system and the nature
of the correction. Any other inconsistencies will cause the
check of that file system to fail. The following 15
inconsistencies (and only those listed) will be corrected for
the specified file systems:
1. An inode has an incorrect count of the blocks it uses. The
count is corrected.
2. An inode is partially truncated. This can occur if the
system is abnormally halted while a file is being
truncated, leaving it claiming more data blocks than its
size in bytes would require. The extra blocks are freed.
3. A directory has an incorrect child count. The count is
corrected.
4. A directory entry exists for an inode which is unallocated.
The directory entry is removed.
5. A directory entry's filename length is incorrect. The
length is corrected.
6. An inode is unreferenced (has no directory entries anywhere
in the file system). The inode is reconnected in the
/lost+found directory.
7. No /lost+found directory exists, but an inode needs to be
reconnected there. The directory is created.
8. The root directory needs to be expanded in order to make
room for a directory entry for lost+found. The directory
is expanded.
9. The /lost+found directory needs to be expanded in order to
make room for a directory entry for an inode being
reconnected there. The directory is expanded.
10. An inode's link count is incorrect. The count is
corrected.
11. The root control point directory's resource accounting
(blocks, inodes) is incorrect. The counts are corrected.
12. A disk allocation region (DAR) has an incorrect free-block
bitmap. The bitmap is corrected.
13. A DAR has an incorrect free-inode list. The list is
Licensed material--property of copyright holder(s) 2
fsck(1M) DG/UX 5.4 Rel. 2.01 fsck(1M)
corrected.
14. A DAR has incorrect summary counts of used blocks, inodes
or directories. The counts are corrected.
15. The summary counts in the superblock are incorrect. The
counts are corrected.
-q Repair the inconsistencies listed under the -p option without
prompting the user for approval. For all other inconsistencies,
instead of failing as with the -p option, display a course of
action and prompt the user to accept or reject it.
-y Detect all file system inconsistencies and repair them without
prompting the user for approval. This option assumes a "yes"
response to all questions asked by fsck about corrective
actions. Use this option with great caution, since it could
lead to irreversible changes to inconsistent file systems.
-n Detect all file system inconsistencies. For each, display a
course of action and prompt the user to accept or reject it.
This option assumes a "no" response to all questions asked by
fsck about corrective actions. With this option, file systems
are opened with read-only intent.
-r Prior to checking and repairing block special devices (specified
in /etc/fstab or on the command line), convert them to
equivalent character special devices. For some system
configurations, this option speeds up fsck fixes.
-x If a file system is marked mountable in its superblock, do not
check it.
The following options are mutually exclusive, and use of more than
one per invocation is not allowed: -y, -n, -p, -q.
Checking
Checking proceeds without any input from the operator if no errors
are discovered. When a fatal inconsistency is discovered, no further
checking is done on that file system; fsck either exits or proceeds
to the next specified file system. When an inconsistency is
discovered with the -p option, and that error is one of those listed
under -p, fsck fixes the inconsistency without operator approval.
Any other discoveries of inconsistencies require the operator to make
a decision. The fsck program prompts with its recommended action.
If you answer yes, then fsck takes the recommended action. In no
case will any damaging action be taken without approval. Note,
however, that advance approval or disapproval may be given by
invoking fsck with the -y and -n options, respectively.
The fsck program checks for the following inconsistencies. Note that
the term "Bad format" refers to system blocks that do not have the
required self-identification information.
Licensed material--property of copyright holder(s) 3
fsck(1M) DG/UX 5.4 Rel. 2.01 fsck(1M)
⊕ Unreadable or inconsistent superblocks.
⊕ Bad format in superblocks.
⊕ Invalid contents in superblock's reserved area.
⊕ Bad value for superblock's file system size.
⊕ Bad value for superblock's DAR size.
⊕ Bad value for superblock's inode/DAR density.
⊕ Bad value for superblock's default data element size.
⊕ Bad value for superblock's default index element size.
⊕ Bad value for superblock's default directory data element size.
⊕ Bad value for superblock's default directory index element size.
⊕ Bad value for superblock's default first allocation threshold.
⊕ Bad value for superblock's default second allocation threshold.
⊕ Bad format in inode table block.
⊕ Invalid contents in inode's reserved area.
⊕ Files of unknown type.
⊕ Files with bad fragment size.
⊕ Files which are partially truncated.
⊕ Files claiming impossible blocks.
⊕ Files claiming system-area blocks.
⊕ Bad Index-block format.
⊕ Files with incorrect block counts.
⊕ Files claiming already-claimed blocks.
⊕ Unallocated root inode.
⊕ Bad file type for root.
⊕ Incorrect resource limit information in root.
⊕ Incorrect parent directory in root.
⊕ Directories with "holes" (unallocated blocks before end-of-
file).
Licensed material--property of copyright holder(s) 4
fsck(1M) DG/UX 5.4 Rel. 2.01 fsck(1M)
⊕ Bad format in directory blocks.
⊕ Directories with invalid information in reserved areas.
⊕ Directories with empty blocks at end.
⊕ Directories with incorrect child counts.
⊕ Extra directory entries named "." or "..".
⊕ Directory entries with invalid characters in filenames: "/" or
non-ASCII characters.
⊕ Directory entries whose pathnames are too lengthy.
⊕ Directory entries that are out of order.
⊕ Directory entries with incorrect entry lengths.
⊕ Directory entries with incorrect filename lengths.
⊕ Extraneous hard links to directories (including cycles in file
system name space).
⊕ Extraneous hard links to symbolic link files.
⊕ Directory entries to invalid inodes.
⊕ Directory entries to unallocated inodes.
⊕ Files with incorrect space parent.
⊕ Unconnected files or directories.
⊕ Bad or missing lost+found directories.
⊕ Bad lost+found directory entries.
⊕ Root or lost+found directories needing expansion.
⊕ Files with incorrect link counts.
⊕ Incorrect resource allocation counts in control point
directories.
⊕ Bad format in DAR blocks.
⊕ Invalid contents in reserved area of DAR blocks.
⊕ Incorrect free-block bitmaps in DARs.
⊕ Incorrect or incomplete free-inode lists in DARs.
⊕ Incorrect DAR summary counts: blocks used, inodes used,
Licensed material--property of copyright holder(s) 5
fsck(1M) DG/UX 5.4 Rel. 2.01 fsck(1M)
directories used.
⊕ Incorrect superblock summary counts.
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 (decimal) inode
number preceded by the # character.
FILES
/etc/fstab Default list of file systems to check
SEE ALSO
crash(1M), mkfs(1M), mount(1M), checklist(4), fs(4), fstab(4),
crash(8).
Installing the DG/UX System, Customizing the DG/UX System, Managing
the DG/UX System.
NOTES
Fsck works sequentially from the pass numbers listed in
/etc/fstab:that is, it begins at 1 and then runs all other passes in
order. There is no way to start an fsck -p at pass n, where n is an
arbitrary number.
Fsck support for /etc/checklist has been included only for
compatibility purposes. We recommend that you do not have a
checklist file.
Licensed material--property of copyright holder(s) 6