How Unrar Handles Corrupted Recovery Volumes
When extracting multi-part RAR archives, recovery volumes
(.rev files) are designed to reconstruct missing or damaged
archive parts using parity-based error correction. If the recovery
volumes themselves are corrupted, unrar evaluates the
integrity of each individual volume, discards unusable parity blocks,
and only proceeds if enough healthy recovery files remain to satisfy the
mathematical threshold required for reconstruction.
Initial Integrity Verification
Before initiating any data reconstruction, unrar reads
the header and block checksums (typically CRC32 for RAR4 or BLAKE2sp for
RAR5) of every available .rev file. Recovery volumes do not
possess a self-healing mechanism; they cannot repair other damaged
recovery volumes. If unrar detects a checksum mismatch or
structural truncation within a .rev file, it immediately
flags that specific volume as invalid and discards it from the recovery
pool.
The Parity Threshold Requirement
RAR archives use erasure coding (such as Reed-Solomon algorithms) to
recover damaged sets. The fundamental rule of this mechanism is simple:
to reconstruct N missing or corrupted data volumes
(.rar, .partXX.rar), the utility requires at
least N fully intact recovery volumes (.rev).
When one or more recovery volumes are damaged:
- Sufficient Valid Volumes: If you have more
.revfiles than missing archive volumes, a corrupted.revfile has no negative impact on the extraction. For example, if two archive parts are missing and you have four.revfiles, but one.revfile is corrupt,unrarstill possesses three valid.revfiles. Because three is greater than or equal to two, the extraction and reconstruction proceed successfully. - Insufficient Valid Volumes: If the corruption of
recovery volumes reduces the count of valid
.revfiles below the number of missing main volumes, the mathematical threshold cannot be met. In this state,unrarcannot reconstruct the missing data.
Extraction Failure and Error Handling
When the valid recovery volume count falls below the required
threshold, unrar aborts the reconstruction process. It
typically reports a checksum error or outputs a message indicating that
the archive is corrupt or that there are not enough recovery volumes to
rebuild the dataset.
If the extraction is executed using standard commands,
unrar deletes any partially unpacked or incomplete files to
avoid leaving corrupt data on the disk. However, if invoked with the
keep broken files flag (-kb), unrar will
extract whatever intact data it can read up to the point of corruption,
though any files spanning the damaged or missing volumes will remain
incomplete.