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 and cannot exceed the protected data size or 256 MB, whatever is less.

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 more efficient than RAR 4.x record in case of multiple damaged areas and shifted data positions.

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.

Maximum allowed RAR 5.0 recovery record size is 1000%. Larger recovery records are processed slower both when creating and repairing.

If you use the plain 'rr' command without optional parameter, WinRAR will set the recovery record size to 3% of archive size by default.

While the recovery record improves chances to repair damaged archives, it does not guarantee the successful recovery. Consider combining the recovery record feature with making multiple archive copies to different media for important data.

This command is the command line equivalent of archive management command Protect archive from damage.

Examples

  1. add a data recovery record of the default size (3%) to the archive backup

WinRAR rr backup

  1. add a data recovery record to the archive pictures and set its size to 5% of the total archive size

WinRAR rr5p pictures