The fsck command checks and repairs file systems. To execute fsck for checking and repairing file systems, you need root privileges. Additionally, if a file system is already mounted, you cannot use fsck to check and repair it.
Example:# fsck /dev/sdb ←Check "/dev/sdb" fsck from util-linux 2.23.2 e2fsck 1.42.9 (28-Dec-2013) /dev/sdb is mounted. ←Report that it's mounted, preventing fsck from proceeding e2fsck: Cannot continue, aborting. # umount /dev/sdb ←Unmount "/dev/sdb" # fsck /dev/sdb ←Once unmounted, use fsck to check "/dev/sdb" and attempt repairs if errors are found |
For more operation examples, explanations, and options, please refer to the provided link.