sudo fsck -y -f -c /dev/sda1
If you encounter an error, you most likely need to unmount the partition:
sudo umount /dev/sda1
Keys and parameters for the fsck command:
y — always answer yes to all questions (an alternative is the p flag, which starts the check in fully automatic mode);
f — force filesystem check (even if the filesystem is marked as clean)
c — searches for bad blocks and marks them accordingly
/dev/sda1 — the device or partition to be checked. Note that the command may have a different format
