Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fsck(C) — Xenix 2.3.4g

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

checklist(F)

filesystem(F)

autoboot(M)

init(M)

FSCK(C)



     FSCK(C)                  XENIX System V                   FSCK(C)



     Name
          fsck - Checks and repairs file systems.

     Syntax
          /bin/fsck [ options ] [ file-system ] ...

     Description
          fsck audits and interactively repairs inconsistent
          conditions for XENIX System V file systems.  If the file
          system is consistent, the the number of files, number of
          blocks used, and number of blocks free are reported.  If the
          file system is inconsistent, the operator is prompted for
          concurrence before each correction is attempted.  It should
          be noted that most corrective actions result in some loss of
          data.  The amount and severity of the loss may be determined
          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 permission fsck defaults to the  action of the -n
          option.

          The following flags are interpreted by fsck:

          -y    Assumes a yes response to all questions asked by fsck.

          -n    Assumes a no response to all questions asked by fsck;
                do not open the file system for writing.

          -sb:c Ignores the actual free list and (unconditionally)
                reconstructs a new one by rewriting the super-block of
                the file system. The file system must be unmounted
                while this is done.

                The -sb:c option allows for creating an optimal free-
                list organization.  The following forms are supported:

                  -s
                  -sBlocks-per-cylinder:Blocks-to-skip (file system interleave)
                    (for anything else)

                If b:c is not given, then the values used when the
                file system was created are used.  If these values
                were not specified, then a reasonable default value is
                used.

          -S    Conditionally reconstructs the free list. This option
                is like -sb:c above except that the free list is
                rebuilt only if there are no discrepancies discovered
                in the file system. Using -S forces a ``no'' response
                to all questions asked by fsck.  This option is useful
                for forcing free list reorganization on uncontaminated
                file systems.



     Page 1                                           (printed 8/7/87)





     FSCK(C)                  XENIX System V                   FSCK(C)



          -t    If fsck cannot obtain enough memory to keep its
                tables, it uses a scratch file. If the -t option is
                specified, the file named in the next argument is used
                as the scratch file, if needed. Without the -t flag,
                fsck prompts the operator 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 fsck completes.
                If the system has a large hard disk there may not be
                enough space on another filesystem for the scratch
                file.  In such cases, if the system has a floppy
                drive, use a blank, formatted floppy in the floppy
                drive with (for example) /dev/fd0 specified as the
                scratch file.

          -q    Quiet fsck.  Do not print size-check messages in Phase
                1.  Unreferenced fifo5 files will selectively be
                removed.  If fsck requires it, counts in the
                superblock will be automatically fixed and the free
                list salvaged.

          -D    Directories are checked for bad blocks.  Useful after
                system crashes.

          -f    Fast check.  Check block and sizes (Phase 1) and check
                the free list (Phase 5).  The free list will be
                reconstructed (Phase 6) if it is necessary.

          -rr   Recovers the root file system.  The required
                filesystem argument must refer to the root file
                system, and preferably to the block device (normally
                /dev/root).  This switch implies -y and overrides -n .
                If any modifications to the file system are required,
                the system will be automatically shutdown to ensure
                the integrity of the file system.

          -c    Causes any supported file system to be converted to
                the type of the current file system. The user is
                prompted to verify the request for each file system
                that requires conversion unless the -y option is
                specified.  It is recommended that every file system
                be checked with this option while unmounted if it is
                to be used with the current version of XENIX.  To
                update the active root file system, it should be
                checked with:

                     fsck -c -rr /dev/root

          If no file-systems are specified, fsck reads a list of
          default file systems from the file /etc/checklist.





     Page 2                                           (printed 8/7/87)





     FSCK(C)                  XENIX System V                   FSCK(C)



          Inconsistencies checked are as follows:

          -   Blocks claimed by more than one inode or the free list

          -   Blocks claimed by an inode or the free list outside the
              range of the file system

          -   Incorrect link counts

          -   Size checks:
                Incorrect number of blocks
                Directory size not 16-byte aligned

          -   Bad inode format

          -   Blocks not accounted for anywhere

          -   Directory checks:
                File pointing to unallocated inode
                Inode number out of range

          -   Super block checks:
                More than 65536 inodes
                More blocks for inodes than there are in the file
                system

          -   Bad free block list format

          -   Total free block 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.  The only restriction is that the directory
          lost+found must preexist in the root of the file system
          being checked and must have empty slots in which entries can
          be made.  This is accomplished by making lost+found, copying
          a number of files to the directory, and then removing them
          (before fsck is executed).

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

     Files
          /etc/checklist      Contains default list of file systems to check
          /etc/default/boot   Automatic boot control

     See Also
          checklist(F), filesystem(F), autoboot(M), init(M)




     Page 3                                           (printed 8/7/87)





     FSCK(C)                  XENIX System V                   FSCK(C)



     Diagnostics
          The diagnostics produced by fsck are intended to be self-
          explanatory.

     Notes
          fsck will not run on a mounted non-raw file system unless
          the file system is the root file system or unless the -n
          option is specified and no writing out of the file system
          will take place.  If any such attempt is made, a warning is
          displayed and no further processing of the file system is
          done for the specified device.

          Although checking a raw device is almost always faster,
          there is no way to tell if the file system is mounted.  And
          cleaning a mounted file system will almost certainly result
          in an inconsistent superblock.

     Warning
          File systems created under -86 version 3.0 are not supported
          under  System V because the word ordering in type long
          variables has changed.  fsck is capable of auditing and
          repairing  version 3.0 file systems if the word ordering is
          correct.

          For the root file system, ``fsck -rr /dev/root'' should be
          run. For all other file systems, ``fsck /dev/??'' on the
          unmounted block device should be used.




























     Page 4                                           (printed 8/7/87)



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