Can unrar Repair a Broken Archive?
The standalone command-line utility unrar cannot
natively repair a broken or corrupted archive. While it can detect
corruption using its integrity test function, the actual repair routine
is deliberately excluded from unrar and is only available
in the full rar command-line utility or the graphical
WinRAR application. However, unrar does allow users to
salvage usable data from damaged archives by ignoring read errors during
extraction.
Why unrar Cannot
Repair Archives
The unrar executable is a lightweight, freeware tool
distributed exclusively for viewing and decompressing RAR archives. Its
command set is limited to operations such as extracting (x,
e), testing (t), and listing (l,
v).
The repair command (r) belongs strictly to the full
rar program. Even in environments with the complete
archiver installed, rebuilding a damaged archive natively is only
possible if the archive was initially created with an embedded recovery
record (RR) or recovery volumes (.rev).
How to Salvage Files Using
unrar
Even though unrar cannot fix corrupted headers or
rebuild missing sectors, it can prevent corrupted files from being
automatically deleted after an extraction error. By default,
unrar discards incomplete or corrupt files upon
encountering a checksum (CRC) mismatch.
To force unrar to retain broken files during extraction,
use the -kb (Keep Broken) switch:
unrar x -kb archive.rarThis command extracts all readable data, allowing you to access intact sections of large media files, text archives, or undamaged files inside a multi-file archive.
The Correct Way to Repair a Corrupted RAR File
To perform an actual repair without third-party tools, you must
switch from unrar to the full rar command-line
package or the WinRAR desktop client.
Via Command Line (
rar): Execute the repair command:rar r archive.rarIf a recovery record exists, the tool reconstructs the damaged blocks and outputs a new file named
fixed.archive.rar.Via Graphical Interface (WinRAR): Open the archive in WinRAR, navigate to Tools, and select Repair archive (or press
Alt + R). Choose whether to treat the file as a standard RAR or ZIP format, and click OK.
Without a pre-existing recovery record, neither rar nor
WinRAR can reconstruct missing data, meaning forced extraction via
unrar -kb is typically the only native option for salvaging
content.