In order to check and repair a Linux filesystem, the fsck
program is used. In reality, fsck
is just a frontend for the filesystem specific checker (similar to mkfs
).
The fsck
program can be run on different filesystems in parallel to speed up processing. Note that this feature can be disabled on low resource machines.
In general, the syntax for fsck
is as follows:
fsck [-lsAVRTMNP] [-C [fd]] [-t fstype] [filesys...] [--] [fs-specific-options]
The fsck
program if used incorrectly, can corrupt the data currently residing on the partition. So make sure you have taken all the desired backups before proceeding with this command. Once this action has been taken, it cannot be reversed. If you would like to follow these steps, you may first want to practice on a USB stick you don’t care about.
The device must be unmounted before running the command.