Checks file system consistency and interactively repairs the file system.
fsck [ FileSystem ... ]
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.
Value | Description |
---|---|
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. |
fsck /dev/hd1
This
command checks the unmounted file system located on the /dev/hd1 device.