Header Corruption vs Data CRC Error in Unrar

When extracting RAR archives using the unrar utility, users frequently encounter integrity errors labeled as either header corruption or a data CRC error. While both indicate that an archive is damaged, they represent failures at fundamentally different layers of the RAR file structure. Header corruption means the metadata detailing how the archive is structured cannot be read, preventing extraction from beginning or continuing normally. A data CRC error, on the other hand, means the metadata was successfully read, but the actual compressed contents inside the file were altered, damaged, or incomplete during transit or storage.

Understanding RAR File Architecture

A RAR archive is divided into two primary components: headers and data blocks.

  • Headers contain metadata, including file names, folder structures, compression methods, file attributes, encryption flags, and individual checksums for the headers themselves.
  • Data blocks contain the actual compressed payload of the files stored within the archive.

Because these two components serve different purposes, unrar handles their verification and error reporting separately.

What is a Header Corruption?

A header corruption error occurs when unrar attempts to read the metadata blocks and finds them malformed, unreadable, or failing the header-specific checksum validation.

When a header is corrupted:

  • Extraction Halts Early: The utility cannot reliably determine file boundaries, original file sizes, or the compression algorithm used. Consequently, it often cannot even begin extracting the affected file.
  • Missing File Information: unrar may display scrambled file names, report incorrect archive sizes, or fail to recognize the file as a valid RAR archive altogether.
  • Structural Failure: In multi-part (split) archives, a corrupted header in one volume can break the chain, preventing the utility from locating the next volume.

Header corruption typically stems from partial downloads affecting the beginning of the file, storage drive sector failures, or interrupted write operations while creating the archive.

What is a Data CRC Error?

A data CRC (Cyclic Redundancy Check) error occurs after unrar successfully reads the archive's headers, decompresses the data block, and calculates a checksum for the resulting output.

When the archive was originally created, WinRAR or the RAR utility calculated a mathematical hash (a CRC32 or BLAKE2sp checksum) of the original uncompressed file and stored that value inside the file header. During decompression, unrar recalculates this checksum on the fly. If the calculated checksum does not match the stored checksum, a "CRC failed" error is thrown.

Key characteristics of a CRC error include:

  • The File Structure is Intact: unrar knows the exact file name, timestamp, and size.
  • Extraction Completes with Errors: By default, unrar deletes the extracted file after reporting the error, but the decompression process itself actually executed.
  • Targeted Damage: The corruption is confined to the actual file content rather than the container's structural blueprint.

Key Differences

Feature Header Corruption Data CRC Error
Point of Failure Archive metadata (structural descriptors) File payload (actual file contents)
Stage Detected Before or during file parsing After or during file decompression
Impact on Extraction Prevents extraction setup; files cannot be processed File extracts, but output is flagged as corrupt
Partial Recovery Rarely possible without specialized repair tools Possible using the "keep broken files" flag

Troubleshooting and Resolution

Resolving these errors depends on the type of failure:

  • Use the Recovery Record: If the archive was created with a recovery record (RR), running unrar r archive.rar or repairing it in WinRAR can rebuild both damaged headers and payload blocks.
  • Keep Broken Files (for CRC Errors): If you are dealing with a CRC error on video, audio, or text files, you can force unrar to retain the damaged file by using the -kb switch (unrar x -kb archive.rar). Media players can often play partially corrupted video or audio streams despite CRC mismatches.
  • Re-download or Re-transfer: If header corruption occurs and no recovery record is present, the archive generally cannot be salvaged manually, requiring the file to be re-downloaded or re-acquired from the source.