Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ffsfsck(8)

mklost+found(8)

fstyp(8)

ncheck(8)

crash(8)

uadmin(2)

checklist(4)

fs(4)



  fsck(8)                             CLIX                             fsck(8)



  NAME

    fsck, dfsck - Checks and repairs file systems

  SYNOPSIS

    /etc/fsck [-y] [-n] [-sX] [-SX] [-t file] [-q] [-D] [-f] [-b] [special]

    /etc/dfsck [options1] special1 ... - [options2] special2 ...

  FLAGS

    -y        Assumes a ``yes'' response to all questions asked by the fsck
              command.

    -n        Assumes a ``no'' response to all questions asked by the fsck
              command, but does not open the file system for writing.

    -sX       Ignores the actual free list and unconditionally reconstructs a
              new one by rewriting the superblock of the file system.  The
              file system should be unmounted while this is done.  If this is
              not possible, care should be taken that the system is quiescent
              and that it is rebooted immediately afterwards.  This precaution
              is necessary so that the old, bad, in-core copy of the
              superblock will not continue to be used, or written on the file
              system.

              The -sX flag allows for creating an optimal free-list
              organization.  If X is not given, the values used when the file
              system was created are used.  The format of X is cylinder-
              size:gap-size.

    -SX       Conditionally reconstructs the free list.  This flag is like -sX
              above except that the free list is rebuilt only if there were no
              discrepancies discovered in the file system.  Using -S will
              force a ``no'' response to all questions asked by the fsck
              command.  This flag is useful for forcing free list
              reorganization on uncontaminated file systems.

    -t file   If the fsck command cannot obtain enough memory to keep its
              tables, it uses a scratch file.  If the -t flag is specified,
              the file named in the next argument is used as the scratch file,
              if needed.  Without the -t flag, the fsck command will prompt
              the user for the name of the scratch file.  The file chosen
              should not be on the file system being checked, and if it is not
              a special file or did not already exist, it is removed when the
              fsck command completes its processing.

    -q        Quiet mode for the fsck command.  In this mode, the command does
              not display size-check messages.  Unreferenced FIFOs will
              silently be removed.  If the fsck command requires it, counts in



  2/94 - Intergraph Corporation                                              1






  fsck(8)                             CLIX                             fsck(8)



              the superblock will be automatically fixed and the free list
              salvaged.

    -D        When using this flag, directories are checked for bad blocks.
              This flag is useful after system crashes.

    -f        Fast check mode.  This flag causes the command to check blocks,
              sizes and check the free list.  The free list will be
              reconstructed if it is necessary.

    -b        Reboot flag.  If the file system being checked is the root file
              system and modifications have been made, then the user must
              either remount the root file system or reboot the system.  A
              remount is done only if there was minor damage.

  DESCRIPTION

  Fsck Command

    The fsck command audits and interactively repairs inconsistent conditions
    for file systems.  If the file system is found to be consistent, the
    number of files, blocks used, and blocks free are reported.  If the file
    system is inconsistent the user is prompted for concurrence before each
    correction is attempted.  It should be noted that most corrective actions
    will result in some loss of data.  The amount and severity of data loss
    may be determined from the diagnostic output.  The default action for each
    correction is to wait for the user to respond yes or no.  If the user does
    not have write permission, the fsck command defaults to a -n action.

    The fsck command audits an fs type file system as the default file system
    and also acts as a front-end driver for other file system types.  if the
    file system is not the default type, it executes the fstyp command, forms
    a pathname from the output, and executes the audit program so formed.  for
    example, if the fstyp command reports the file system to be of type ffs,
    the fsck command will cause the ffsfsck command to execute.

    If no special files are specified, the fsck command will read a list of
    default file systems from the file /etc/checklist.  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
        file system.

    3.  Incorrect link counts.

    4.  The following size checks are carried out:

        a.  Incorrect number of blocks.




  2                                              Intergraph Corporation - 2/94






  fsck(8)                             CLIX                             fsck(8)



        b.  Directory size not 16-byte aligned.

    5.  Bad inode format.

    6.  Blocks not accounted for anywhere.

    7.  The following directory checks are made:

        a.  File pointing to unallocated inode.

        b.  inode number out of range.

    8.  The following superblock checks are made:

        a.  More than 65536 inodes.

        b.  More blocks for inodes than there are in the file system.

    9.  Bad free block list format.

    10. Total free block and/or free inode count incorrect.

    If orphaned files and directories (allocated but unreferenced) contain
    data, with the user's concurrence, they are reconnected by placing them in
    the file system's lost+found directory.  The user will be notified whether
    the file or directory is empty.  Empty files or directories are removed,
    as long as the -n flag is not specified.  The fsck command will force the
    reconnection of nonempty directories.  The name assigned is the inode
    number.  The only restriction is that the directory lost+found must
    preexist in the root directory of the file system being checked and must
    have empty slots in which entries can be made.  This is accomplished by
    running the mklost+found command in the root directory of the file system
    when the file system is created.

    Checking the raw device is always faster and should be used with
    everything but the root file system.

  dfsck Command

    The dfsck command allows two file system checks on two different drives
    simultaneously.  The options1 and options2 are used to pass options to
    fsck for the two sets of file systems.  A - is used as the separator
    between the file system groups.

    The dfsck command permits a user to interact with two fsck commands at
    once.  To aid in this, the dfsck command displays the file system name for
    each message to the user.  When answering a question from dfsck, the user
    must prefix the response with a 1 or a 2 (indicating that the answer
    refers to the first or second file system group).

  FILES



  2/94 - Intergraph Corporation                                              3






  fsck(8)                             CLIX                             fsck(8)



    /etc/checklist   Contains default list of file systems to check

  CAUTIONS

    The inode numbers for . and .. in each directory are not checked for
    validity.

  DIAGNOSTICS

    In addition to the diagnostic messages displayed below, other messages may
    be displayed while checking the file system and are normal to the
    operation of the fsck command.

    Can't open checklist file: file
           The /etc/checklist file is missing.

    Cannot exec fsck_command
           The fsck command appropriate to the file system type could not be
           invoked.  This may indicate an unusual file system type.

    ROOT INODE UNALLOCATED. TERMINATING.
           The inode for the root directory does not exist.  The fsck command
           cannot repair this error.

  EXIT VALUES

    The following exit values are returned for the fsck command:

    0   Check Completed.

    8   fsck error (bad options, out of memory, couldn't open file)

    4   Directory pathname too long.

  RELATED INFORMATION

    Commands:  ffsfsck(8), mklost+found(8), fstyp(8), ncheck(8), crash(8)

    Functions: uadmin(2)

    Files:  checklist(4), fs(4)













  4                                              Intergraph Corporation - 2/94




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