Repairing RAR archives

Software

A few days ago, I was downloading a series of hefty RAR archives from the server of a former client of mine (I had left a lot of resources there and forgotten to retrieve them after our collaboration ended). The download process was really slow, and after downloading hundreds of megabytes of stuff, I was prepared for a little trip down memory lane, so I started extracting the archives using the always good UnRarX. However, I was immediately greeted with a series of CRC errors. (This article explains what CRC errors are in the context of .zip archives.)

What to do? Re-downloading may have been an option, but the slow speeds weren’t encouraging. A quick search of the Web revealed that I could try to repair the compressed archives. With what, exactly? Well, this old MacRumors Forum thread pointed me in the right direction: going to RarLab and downloading RAR 4.01 for Mac OS X (from this page).

Yes, it’s a command line tool, but nothing too difficult or scary. After downloading it, you’ll have a rarosx-4.0.1.tar.gz archive in your destination folder. Double-click it, and it’ll create a ‘rar’ folder. Inside this folder you’ll find some text files and two UNIX executables, rar and unrar. The process is now rather simple:

1. Open the Terminal.

2. Drag the rar executable on the Terminal window.

3. You have just executed the rar command. You’ll see a prompt like this:

4. Make sure there’s a space after the cursor. Type r then another space.

5. Go to the Finder, and drag the RAR archive to be repaired on the Terminal window. The Terminal prompt should look like this now:

Richard-XV:~ rick$ /Applications/Utilities/rar/rar r /Users/rick/Downloads/example.rar _

(of course your output will be slightly different. Here, rick is my Home folder and username, the “/Applications/Utilities/rar/” before the rar command is the path where the executable is located, and the “/Users/rick/Downloads/” before the RAR archive is the path where the corrupt archive is located).

6. After the archive name, enter another space, then start typing the path to the destination folder where you want the fixed archive to be saved. To keep things simple, I just entered my Home folder, like this:

Richard-XV:~ rick$ /Applications/Utilities/rar/rar r /Users/rick/Downloads/example.rar /Users/rick/

(Note the spaces. Also note that this should be all on a single line in Terminal.)

7. Hit Return. The repair scan will begin, and then hopefully the repairing process as well. This operation can last seconds or minutes, depending on the size of the archive.

8. If all goes well, you should have a new RAR archive in the folder you specified above. It will have a fixed prefix. In this case, in /Users/rick/, the file fixed.example.rar will be generated.

9. Remember that if you’re repairing a series of split RAR archive parts that need to be joined afterwards, you’ll have to rename the repaired files deleting the fixed prefix in their names.

That’s it. I was able to successfully repair a 526 MB, a 335 MB and a 614 MB RAR archives in a matter of minutes.

The Author

Writer. Translator. Mac consultant. Enthusiast photographer. • If you like what I write, please consider supporting my writing by purchasing my short stories, Minigrooves or by making a donation. Thank you!

1 Comment

  1. Just tried with two independent segmented RAR archives. StuffIt Expander said they were corrupted (It said «The structure of the archive is damaged»). I was going to try your method, but decided to try to decompress the file simply using the official unrar command and it worked flawlessly.
    So it is possible that the files weren’t really corrupted but the decompression engines of UnRarX and StuffIt have some problem with some of them. Or maybe the official unrar can automatically repair files without noticing.

Comments are closed.