Always only run fsck on unmounted or read-only mounted filesystems. This is mandatory; otherwise, fsck might perform an operation on a file a user has open, causing corruption. If it’s the root filesystem, you should either do it in single-user mode or use the rescue CD-ROM to ensure that the root is mounted read-only.
Example 9-12 shows a sample of a check on a filesystem.
# fsck -v /dev/sda1fsck from util-linux 2.25.2e2fsck 1.42.11 (09-Jul-2014)/dev/sda1 is mounted.e2fsck: Cannot continue, aborting.# umount /dev/sda1# fsck -v /dev/sda1fsck from util-linux 2.25.2e2fsck 1.42.11 (09-Jul-2014)/dev/sda1: clean, 430/128016 files, 182615/512000 blocks
The system would ...