5

I can't extract an 8GB rar file in the terminal. When I try, I get this error:

$ unrar --extract largefile.rar 
unrar: invalid archive 'largefile.rar': Value too large for defined data type                                                                                                             
Usage: unrar [OPTION...] ARCHIVE [FILE...] [DESTINATION]                                                                                                                                        
Try `unrar --help' or `unrar --usage' for more information.                                                                                                                                     
  • 1
    If you are running Linux 32 bit, there is a big change you won't be able to extract a RAR archive bigger than 4 GB (or even bigger than 2 GB). You may need to execute your command on a 64 bit Linux. – Huygens Mar 13 '13 at 8:30
  • 1
    hmm, I'm quite sure that rar shouldn't keep the entire file in memory as it extracts, would it? – Journeyman Geek Mar 13 '13 at 8:43
  • @Huygens: Although your concerns make sense, you cannot put that into the question before the OP verifies that that is the case. – TFM Mar 13 '13 at 8:58
  • @TFM I thought I had made it more "neutral" in the proposed update. But agreed on the principles. Thanks for the feedback. – Huygens Mar 13 '13 at 9:06
  • 1
    "Many system calls that deal with files return values in a long int data type. On 32-bit hardware a long int is 32-bits and therefore this imposes a 2GB limit on the size of files." (link) – Suuuehgi Apr 27 '18 at 19:56
4

I had the same problem on a Ubuntu 16 with an ARMv7 CPU. I managed to unpack a problematic archive with unar without problems.

| improve this answer | |
  • 1
    Nice find! unar indeed seems to be capable of handling files > 2 GB on 32 bit systems! – Suuuehgi Apr 27 '18 at 19:50
  • I unrared a 15gb rar file with unar on Rapsberry PI3 running Raspbian. Life saver. Thanks. – Sinan Eldem Nov 12 at 3:23
2

You need the 64bit version of unrar to extract files of this size. There may be a work around to extract this with unrar but I can't seem to figure it out.

If you can re-create the archive use:

rar a -v2097152k -R output-file.rar input-file  

This will ensure that your rar is saved in 2gb chunks and you will be able to unrar it again.

I think the best option for you is just to unrar this file on another machine.

| improve this answer | |
-1

I encountered this issue on my ARMv7 CPU with 2GB of RAM. Unfortunately using unar did not work for RAR5 archives. The solution for me is to use the unrar package as opposed to unrar-free in the OP.

To install unrar we need to enable the multiverse repository.

sudo apt-add-repository multiverse && sudo apt-get update

then

sudo apt-get install unrar
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.