Command RR[N] - add data recovery record
Optionally, redundant information (recovery record) may be added to RAR archive. While it increases the archive size, it helps to recover archived files in case of disk failure or data loss of other kind, provided that damage is not too severe. Such damage recovery can be done with command "r". ZIP archive format does not support the recovery record.
RAR 4.x and RAR 5.0 archives use different recovery record structure and algorithms.
RAR 4.x recovery record is based on XOR algorithm. You can specify 4.x record size as a number of recovery sectors or as a percent of archive size. To specify a number of sectors just add it directly after 'rr', like 'rr1000' for 1000 sectors. To use a percent append 'p' or '%' modifier after the percent number, such as 'rr5p' or 'rr5%' for 5%. Note that in Windows .bat and .cmd files it is necessary to use 'rr5%%' instead of 'rr5%', because the command processor treats the single '%' as the start of a batch file parameter, so it might be more convenient to use 'p' instead of '%' in this case.
RAR 4.x recovery sectors are 512 bytes long. If damaged area is continuous, every sector helps to recover 512 bytes of damaged information. This value may be lower in cases of multiple damage. Maximum number of recovery sectors is 524288.
Size of 4.x recovery record may be approximately determined as <archive size>/256 + <number of recovery sectors>*512 bytes.
RAR 5.0 recovery record uses Reed-Solomon error correction codes. Its ability to repair continuous damage is about the same as for RAR 4.x, allowing to restore slightly less data than recovery record size. But it is significantly more efficient than RAR 4.x record in case of multiple damaged areas.
RAR 5.0 record does not use 512 byte sectors and you can specify its size only as a percent of archive size. Even if '%' or 'p' modifier is not present, RAR treats the value as a percent in case of RAR 5.0 format, so both 'rr5' and 'rr5p' mean 5%. Due to service data overhead the actual resulting recovery record size only approximately matches the user defined percent and difference is larger for smaller archives.
RAR 5.0 recovery record size cannot exceed the protecting archive size, so you cannot use more than 100% as a parameter. Larger recovery records are processed slower both when creating and repairing.
Both 4.x and 5.0 records are most efficient if data positions in damaged archive are not shifted. If you copy an archive from damaged media using some special software and if you have a choice to fill damaged areas with zeroes or to cut out them from copied file, filling with zeroes or any other value is preferable, because it allows to preserve original data positions. Still, even though it is not an optimal mode, both versions of record attempt to repair data even in case of deletions or insertions of reasonable size, when data positions were shifted. RAR 5.0 recovery record handles deletions and insertions more efficiently than RAR 4.x.
If you use the plain 'rr' command without optional parameter, WinRAR will set the recovery record size to 3% of archive size by default.
This command is the command line equivalent of archive management command Protect archive from damage.
Examples
- add a data recovery record of the default size (3%) to the archive backup
WinRAR rr backup
- add a data recovery record to the archive pictures and set its size to 5% of the total archive size
WinRAR rr5p pictures