lima-vm/lima · critical

omap node checksum failed

Error message

omap node checksum failed

What it means

omapLookup reads each B-tree node of an omap and verifies its fletcher-64 checksum before parsing. This error means the block at the omap tree root (or a child reached during descent) failed checksum validation, so its contents are treated as corrupt and refused rather than parsed. APFS uses these per-block checksums to detect media and copy corruption.

Source

Thrown at pkg/apfs/chown.go:300

				rootTreeOID:  le.Uint64(volBlock[apfsRootTreeOIDOff:]),
				latestXID:    le.Uint64(volBlock[objXIDOff:]),
			}, nil
		}
	}
	return nil, fmt.Errorf("no volume with role %#x found", role)
}

// omapLookup searches the omap B-tree for a virtual OID, returning
// the physical address from the entry with the highest xid <= maxXID.
func (c *container) omapLookup(omapTreeAddr, oid, maxXID uint64) (uint64, error) {
	blk, err := c.readBlock(omapTreeAddr)
	if err != nil {
		return 0, err
	}

	for {
		if verifyChecksum(blk) != nil {
			return 0, errors.New("omap node checksum failed")
		}
		if err := verifyBTreeNodeType(blk); err != nil {
			return 0, fmt.Errorf("omap node: %w", err)
		}
		flags := le.Uint16(blk[btnFlagsOff:])
		nkeys := le.Uint32(blk[btnNKeysOff:])
		tspOff := le.Uint16(blk[btnTableSpaceOff:])
		tspLen := le.Uint16(blk[btnTableSpaceOff+2:])

		tocStart := btnDataOff + uint32(tspOff)
		keyAreaStart := tocStart + uint32(tspLen)

		isLeaf := flags&btnodeLeaf != 0
		isFixedKV := flags&btnodeFixedKVSize != 0
		isRoot := flags&btnodeRoot != 0

		valueAreaEnd := c.blockSize
		if isRoot {

View on GitHub (pinned to dd909d0973)

Solutions

  1. Re-copy the disk image from a cleanly shut-down source.
  2. Run fsck_apfs on the image from a macOS host to repair corrupt metadata blocks.
  3. Confirm the image was not modified concurrently while the tool ran.
  4. If corruption repeats, check host storage health (SMART) for the underlying disk.
  5. Restore the image from a backup.
Defensive patterns

Strategy: try-catch

Try / catch

if err := apfs.Chown(diskPath, role, uid, gid, paths...); err != nil {
	var dom string
	if strings.Contains(err.Error(), "checksum failed") {
		return fmt.Errorf("disk image metadata is corrupt (checksum); restore or fsck_apfs the image: %w", err)
	}
	return err
}

Prevention

When it happens

Trigger: The block at omapTreeAddr (or a child node address read during descent) has a checksum that does not match its computed fletcher64 — typically due to a corrupted image, a partially written block, or a stale address used across snapshots.

Common situations: Disk images copied while the VM was running, images with bad sectors, interrupted writes, or using an omap address/XID from an older transaction after the container was modified.

Related errors


AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01). Data as JSON: /api/errors/02c3f21a5b710ce2. Report an issue: GitHub.