[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
System User's Guide: Operating System and Devices

Checking the Integrity of the File System (fsck Command)

You can check and interactively repair inconsistent file systems with the fsck command. It should be run on every file system as part of system initialization. You must be able to read the device file on which the file system resides (for example, the /dev/hd0 device). 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. The fsck command is conservative in its repair efforts and tries to avoid actions that might result in the loss of valid data. In certain cases, however, the fsck command recommends the destruction of a damaged file.

Attention: Always run the fsck command on file systems after a system malfunction. Corrective actions may result in some loss of data. The default action for each consistency correction is to wait for the operator to enter yes or no. If you do not have write permission for an affected file, the fsck command defaults to a no response in spite of your actual response.

For example, to check all the default file systems, enter:

fsck

This form of the fsck command asks you for permission before making any changes to a file system.

For example, to fix minor problems with the default file systems automatically, enter:

fsck -p

For example, to check the file system /dev/hd1, enter:

fsck /dev/hd1

This checks the unmounted file system located on the /dev/hd1 device.

Note: The fsck command will not make corrections to a mounted file system.

See the fsck command in the AIX Version 4.3 Commands Reference for the exact syntax.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]