OSD_METADATA_INCONSISTENCY

Object Storage Metadata Inconsistency Detected – Fix Now

Hardware – Hard Drives Intermediate 👁 14 views 📅 Jun 17, 2026

Your disk has metadata corruption from a partial write or bad cable. Here's the exact fix and why it works.

Yeah, that error message is annoying. It usually shows up in syslog or your monitoring dashboard, and it means something went wrong with how your object storage system tracks file locations. Don't panic—the fix is straightforward.

The Fix: Run a Consistency Check and Repair

What's actually happening here is that the metadata journal has a checksum mismatch. The most common cause is a power loss or a flaky SATA cable that corrupted a write. I'll give you the commands for Linux with ZFS (most common for object storage nodes) and ext4/XFS.

For ZFS Pools

  1. Identify the pool name – run zpool list to find it. For this example, we'll use tank.
  2. Scrub the poolsudo zpool scrub tank. This reads every block and verifies checksums. It's slow on large pools (hours to days), but it catches silent corruption.
  3. Check scrub statussudo zpool status tank. Look for any lines like PERMANENT ERRORS. If you see metadata errors, we need the next step.
  4. Repair metadatasudo zpool clear tank followed by sudo zpool scrub tank again. The clear command tells ZFS to rewrite metadata blocks from parity or redundant copies. Yes, it seems like a double scrub, but the first scrub just reports errors—the clear is what triggers the rewrite.

For ext4 or XFS Partitions

  1. Unmount the filesystemsudo umount /dev/sdb1. Can't repair a live filesystem safely.
  2. Run fsck with automatic repairsudo fsck -y /dev/sdb1. The -y flag answers "yes" to all repair prompts. For XFS, use sudo xfs_repair /dev/sdb1. Both will rebuild the metadata tree, usually recovering orphaned inodes.
  3. Remount and checksudo mount /dev/sdb1 /mnt/data then dmesg | tail -20 to confirm no new errors.

Why This Works

The reason step 3 works for ZFS is that zpool clear doesn't just clear error counters—it invalidates the cached checksums for the damaged metadata blocks. When the second scrub runs, it's forced to reconstruct those blocks from the RAID parity or mirrored copy. If you have a single-disk pool, ZFS can't reconstruct, so you'd need to restore from backup. That's why you should never run object storage on a single disk without redundancy.

For ext4/XFS, fsck looks at the superblock and inode tables. The metadata inconsistency usually means the journal had a partially committed transaction. fsck detects that the journal replay didn't finish, rolls back the incomplete transaction, and then replays it cleanly. This fixes the inconsistency without data loss unless the actual data block was also corrupted.

Less Common Variations

Sometimes the error appears only on specific objects, not the whole pool. In Ceph, you might see OSD_METADATA_INCONSISTENCY for a single PG (placement group). The fix there is different:

  1. Find the OSD: ceph osd find 12 (replace 12 with your OSD ID).
  2. Stop the OSD: systemctl stop ceph-osd@12.
  3. Repair the PG: ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-12 --pgid 1.2f4 --op repair. This rewrites metadata for that specific PG.
  4. Restart the OSD: systemctl start ceph-osd@12.

Another weird one: corruption from a bad SATA cable that only shows up under high IOPS. If the error reoccurs after fixing, swap the cable. I've seen brand-new cables fail after 3 months. Use a known-good SAS cable if you can—they have better shielding.

Prevention

ActionWhy
Replace SATA cables every 2 yearsThey degrade with heat and vibration. A cheap cable costs $5; a drive rebuild costs hours.
Enable write-back cache with battery backupPrevents partial writes from power loss. On consumer SSDs, disable volatile write cache entirely.
Schedule monthly scrubsCatch metadata rot before it spreads. On ZFS: zpool scrub tank in cron. On ext4: e2fsck -p /dev/sdb1.
Monitor SMART attributesWatch Current_Pending_Sector and Reallocated_Sector_Ct. Rising numbers mean the disk is failing.

The real fix isn't just repairing once—it's fixing the root cause. In my experience, 80% of metadata inconsistencies come from bad cables or power issues. The other 20% are failing drives. If you see this error more than twice in a month, replace the cable and the drive. You'll save yourself a headache later.

Was this solution helpful?