Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

crash(1M)

mkfs(1M)

mount(1M)

checklist(4)

fs(4)

fstab(4)

crash(8)



fsck(1M)                       DG/UX R4.11MU05                      fsck(1M)


NAME
       fsck - check file systems for consistency and repair them

SYNOPSIS
       /sbin/fsck [-l] [-y] [-n] [-p] [-q] [-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]
                           [file_system_names].

   Options
       All options 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
            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
                 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
            automatically, without asking for user approval.  Unlike -p,
            however, more serious inconsistencies will not cause fsck to
            fail;  the user must still answer the resulting queries.

       -y   Audit and interactively repair all file system inconsistencies
            assuming a "yes" response to all questions asked by fsck.  This
            option should be used with great caution, since it could lead to
            irreversible changes to the file system.

       -n   Audit and interactively repair all file system inconsistencies,
            assuming a "no" response to all questions asked by fsck.  This
            option also means that all file systems will be opened with
            read-only intent.

       -x   File systems are examined before being checked.  If a file
            system is marked mountable in its superblock, then it is not
            checked.

       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, the inconsistency if fixed 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.

       ·    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).

       ·    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,
            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.

       Checking the character-special device (/dev/rdsk/*) is almost always
       faster then checking the block-special device (/dev/dsk/*).

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, 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.

       One of the file system inconsistencies checked by fsck is the
       presence of inodes that are not owned by any directories.  When such
       an inode is found, fsck attempts to make a new directory called
       /lost+found in the root directory of the file system and place the
       unclaimed inode into that directory.  In order to create the new
       directory, fsck must allocate space in the file system for the
       directory entry.  fsck cannot create /lost+found if the file system
       is completely full.  In this case, inodes will be left in the file
       system that are not visible in any directory.  The solution to this
       problem is to mount the file system and either free space by deleting
       unnecessary files or expand the file system using sysadm.  Then, run
       fsck again to reclaim the lost inodes.


Licensed material--property of copyright holder(s)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026