Why does fsck show corruption when running 'fsck -n' on a mounted device when the devices are clean?
Issue
- Issuing an
fsck -non a mounted in use device reports filesystem corruption, but when running afsckwhen the device is unmounted it reports the device as clean. - The following types of errors are encountered when running a
fsckon a mounted filesystem:
# fsck -n /dev/mapper/VolGroup-lv_test
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
Warning! /dev/mapper/VolGroup-lv_test is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
/dev/mapper/VolGroup-lv_test contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences: -2974075
Fix? no
Free blocks count wrong for group #90 (2630, counted=2629).
Fix? no
Free blocks count wrong (7702583, counted=7714667).
Fix? no
Free inodes count wrong (7285539, counted=7285465).
Fix? no
/dev/mapper/VolGroup-lv_test: ********** WARNING: Filesystem still has errors **********
/dev/mapper/VolGroup-lv_test: 103645/7389184 files (0.4% non-contiguous), 21826505/29529088 blocks
- However, when the device is unmounted an
fsckreports no problems:
# fsck -fy /dev/mapper/VolGroup-lv_test
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/mapper/VolGroup-lv_test: 103645/7389184 files (0.4% non-contiguous), 21826505/29529088 blocks
Environment
- Red Hat Enterprise Linux
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
