Often you’ll need to perform filesystem checks to find and fix issues on your system partitions. They can occur after a power failure, if a mechanical issue exists, etc. The inbuilt tool to perform such operations is fsck which gets shipped with almost all Linux distributions. I usually use this command with the -ACV parameters, as follows:
-A – check all files
-v – verbose output
-C – show progression
Note that you cannot perform a check on a mounted filesystem. It’s best that you execute fsck only after you unmount the filesystem or on a read-only file system:
[root@localhost /home/dpopescu]# fsck -ACV
fsck from util-linux-ng 2.17.2
Checking all file systems.
[/sbin/fsck.ext4 (1) — /] fsck.ext4 -C0 /dev/sda2
e2fsck 1.41.12 (17-May-2010)
/dev/sda2 is mounted.
e2fsck: Cannot continue, aborting.