Why does fsck show corruption when running 'fsck -n' on a mounted device when the devices are clean?

Solution Verified - Updated -

Issue

  • Issuing an fsck -n on a mounted in use device reports filesystem corruption, but when running a fsck when the device is unmounted it reports the device as clean.
  • The following types of errors are encountered when running a fsck on 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 fsck reports 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 (RHEL)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content