What does 'Filesystem state: clean with errors' in dumpe2fs output means, and what should be done next?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 10
  • Red Hat Enterprise Linux 9
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 6
  • EXT4 file system

Issue

  • The output of dumpe2fs -h command for a device reports filesystem state as "clean with errors"
  • What does this message mean?
  • What should be done, for fixing this further?

    # dumpe2fs -h /path/to/dev/device | grep 'Filesystem state'
    Filesystem state:         clean with errors
    

Resolution

  • It is advised to check with your storage vendor to confirm whether any storage failure immediately preceded the filesystem corruption. Please ensure that any storage issues have been resolved before proceeding with a repair or filesystem check; otherwise, it can exacerbate the issue. If needed, Red Hat Support can assist in reviewing the system logs to determine if it is possible to diagnose the Root Cause of the corruption.
  • Since, the filesystem state is not marked as clean, a filesystem check would be required for fixing the inconsistencies further.
  • Prior to running a filesystem check, it must be ensured that the affected filesystem is completely backed up. This is because, running filesystem checks or repair, often result in data loss! During such a situation, data must be recovered from a last known backup.
  • Unmount and run a filesystem check on the affected filesystem:

    # umount /path/to/mount/point -v
    # e2fsck -fyv /path/to/dev/device
    
  • If the affected filesystem is root based or specifically /, /usr, /var filesystem, then the repair will need to be run from the rescue environment, as these filesystems cannot be unmounted on a running system. This procedure is described in the following article: How to repair filesystem in rescue environment for Red Hat Enterprise Linux?

Root Cause

  • Filesystem state clean with errors indicates that filesystem superblock is aware of some potential problem on the filesystem and the recommended action in this situation is to run fsck as soon as possible. It may be possible to mount the filesystem with this state but it is strongly discouraged to mount file system clean with errors to prevent data corruption.

Diagnostic Steps

  • Logs will contain the following messages when the affected filesystem is mounted.

    kernel: EXT4-fs (sdX): warning: mounting fs with errors, running e2fsck is recommended
    kernel: EXT4-fs (sdX): mounted filesystem with ordered data mode. Opts:
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments