HPUX fsck[1m]






 fsck(1M)                                                           fsck(1M)





 NAME
      fsck - file system consistency check and interactive repair

 SYNOPSIS
      /etc/fsck -p [-F] [special ...]

      /etc/fsck -P [-F] [special ...]

      /etc/fsck [-b block#] [-y] [-n] [-F] [-q] [special ...]

 DESCRIPTION
      fsck audits and interactively repairs inconsistent conditions for HP-
      UX file systems on mass storage device files identified by special.
      If the file system is consistent, the number of files on that file
      system and the number of used and free blocks are reported.  If the
      file system is inconsistent, fsck provides a mechanism to fix these
      inconsistencies, depending on which form of the fsck command is used.

      fsck checks a default set of file systems or the file systems
      specified in the command line.  If special is not specified, fsck
      reads the table in /etc/checklist, using the first field (special-file
      name) to determine which file systems to check.

      If the target device is a swap device, fsck does not continue to
      process.  fsck also checks the target device to ensure a mounted file
      system is not being checked.  If a mounted device is specified but the
      -F option is not, fsck prompts the user for a response.

      If the -p option is used and special is not specified, fsck reads the
      specified pass numbers in /etc/checklist to inspect groups of disks in
      parallel, taking maximum advantage of I/O overlap to preen the file
      systems as quickly as possible.  The -p option is normally used in the
      script /etc/bcheckrc during automatic reboot.  Normally, the root file
      system is checked on pass 1, and other ``root'' (``0'' section) file
      systems on pass 2.  Other small file systems are checked on separate
      passes (such as the ``section 4'' file systems on pass 3 and the
      ``section 7'' file systems on pass 4), and finally the large user file
      systems are checked on the last pass (for example, pass 5).  A pass
      number of zero or a type which is neither rw nor ro in /etc/checklist
      causes a file system not to be checked.  If the optional fields are
      not present on a line in /etc/checklist, or the pass number is -1,
      fsck preens the file system on such lines sequentially after all
      eligible file systems with positive pass numbers have been preened.

      Below are the inconsistencies that fsck with the -p option corrects.
      If it encounters other inconsistencies, it exits with an abnormal
      return status.  For each corrected inconsistency, one or more lines
      are printed identifying the file system on which the correction will
      take place, and the nature of the correction.  Correctible
      inconsistencies are limited to the following:




 Hewlett-Packard Company            - 1 -     HP-UX Release 9.0: August 1992






 fsck(1M)                                                           fsck(1M)





           o  Unreferenced inodes
           o  Unreferenced continuation inodes (see inode(4))
           o  Unreferenced pipes and fifos
           o  Link counts in inodes too large
           o  Missing blocks in the free list
           o  Blocks in the free list also in files
           o  Counts in the super-block wrong.

      The -P option operates in the same manner as the -p option except that
      cleanly unmounted file systems are not checked (see fsclean(1M)).
      This can greatly decrease the amount of time required to reboot a
      system that was brought down cleanly.

      Without the -p or -P option, fsck prompts for concurrence before each
      correction is attempted when the file system is inconsistent.  It
      should be noted that some corrective actions result in a loss of data.
      The amount and severity of data loss can 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 a -n action.

    Options
      fsck recognizes the following options:

           -b      Use the block specified immediately after the flag as the
                   super block for the file system.  An alternate super
                   block can always be found at block
                   ((SBSIZE+BBSIZE)/DEV_BSIZE), typically block 16
                   (DEV_BSIZE is defined in <sys/param.h>).

           -y      Assume a yes response to all questions asked by fsck;
                   this should be used with great caution because this is a
                   free license to continue after essentially unlimited
                   trouble has been encountered.

           -F      Force fsck to check a mounted file system.

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

           -q      Quiet fsck.  Do not print size-check messages in Phase 1.
                   Unreferenced fifos are silently removed.  If fsck
                   requires it, counts in the superblock and cylinder groups
                   are automatically fixed.










 Hewlett-Packard Company            - 2 -     HP-UX Release 9.0: August 1992






 fsck(1M)                                                           fsck(1M)





      In all cases, fsck checks the following inconsistencies:

           o  Blocks claimed by more than one inode or the free list.
           o  Blocks claimed by an inode or the free list outside the range
              of the file system.
           o  Incorrect link counts.
           o  Size checks:
                   -  Directory size not of proper format.
           o  Bad inode format.
           o  Blocks not accounted for anywhere.
           o  Directory checks:
                   -  File pointing to unallocated inode.
                   -  Inode number out of range.
           o  Super Block checks:
                   -  More blocks for inodes than there are in the file
                      system.
           o  Bad free block list format.
           o  Total free block and/or free inode count incorrect.
           o  Invalid continuation inode number in a primary inode.

      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 already exist
      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, then removing
      them (before fsck is executed).

      Unreferenced continuation inodes are removed with the -p option, since
      they do not refer back to the primary inode.  When a primary inode
      contains an invalid continuation inode number, the continuation inode
      number should be cleared (that is, set to 0).  This is not done
      automatically (with the -p option), because access control list
      information may have been lost and should be corrected.

      After fsck has checked and fixed the file system, it stores the
      correct fs_clean flag in the super block if it is not already there.
      For a non-root file system, FS_CLEAN is stored there.  For the root
      file system, which is mounted at the time of the fsck, no changes are
      required to the super block if no problems were found and FS_OK was
      already set.

      Checking the raw device is almost always faster.

 RETURN VALUE
      fsck returns the following values:

            0   Either no errors were detected or all errors were corrected.





 Hewlett-Packard Company            - 3 -     HP-UX Release 9.0: August 1992






 fsck(1M)                                                           fsck(1M)





            4   Root file system errors were corrected.  The system must be
                rebooted.

            8   Some uncorrected errors exist on one or more of the file
                systems checked, there was a syntax error, or some other
                operational error occurred.

           12   A signal was caught during processing.

 WARNINGS
      fsck should not be run on mounted file systems or on the raw root
      device.

    Access Control Lists
      Access control list descriptions in this entry apply only to standard
      HP-UX operating systems.  If HP-UX BLS software has been installed,
      access control lists are handled differently.  Refer to HP-UX BLS
      documentation for information about access control lists in the HP-UX
      BLS environment.

      Be sure the system is in single-user state before running fsck (see
      shutdown(1M)).

 DEPENDENCIES
      Series 300/400/700
           There is only one section per volume.

 AUTHOR
      fsck was developed by HP, AT&T, the University of California,
      Berkeley.

 FILES
      /etc/checklist      contains default list of file systems to check.

 SEE ALSO
      dumpfs(1M), fsclean(1M), mkfs(1M), newfs(1M), shutdown(1M),
      checklist(4), fs(4), inode(4), acl(5).

















 Hewlett-Packard Company            - 4 -     HP-UX Release 9.0: August 1992