[ Bottom of Page | Previous Page | Next Page | Contents | Index | 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 is important run this command 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 can 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 will default to a no response.

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

fsck

Press Enter.

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

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

fsck -p

Press Enter.

For example, to check the /dev/hd1file system , type:

fsck /dev/hd1

Press Enter.

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

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

See the fsck command in the AIX 5L Version 5.2 Commands Reference for the complete syntax.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]