fsck Command

Purpose

Checks file system consistency and interactively repairs the file system.

Syntax

fsck [ FileSystem ... ]

Description

The fsck command checks and interactively repairs inconsistent file systems. Normally, the file system is consistent, and the fsck command merely reports on the number of files, used blocks, and free blocks in the file system. If the file system is inconsistent, the fsck command displays information about the inconsistencies found and prompts you for permission to repair them. If no FileSystem is specified, all file systems are checked.

The fsck command checks for the following inconsistencies:

In addition to its messages, the fsck command records the outcome of its checks and repairs through its exit value. This exit value can be any sum of the following conditions:

0 All checked file systems are now okay.
2 The fsck command was interrupted before it could complete checks or repairs.
4 The fsck command changed the file system; the user must restart the system immediately.
8 The file system contains unrepaired damage.

Exit Status

See Virtual I/O Server command exit status.

Examples

  1. To check a file system, enter:
    fsck /dev/hd1
    This command checks the unmounted file system located on the /dev/hd1 device.

Send feedback |  Rate this page