I have a 100Gb disk which is filled up by .tar.bz2 files that weigh 60Gb. I want to extract the contents of the file but there is no space for the .tar.bz2 file and its content at the same time.

Is there a way to do this?

  • Certainly not if it's solid. – Overmind May 5 '17 at 12:03
  • So what should i do? Maybe my thinking is wrong but there should be a way to part .tar file to smaller parts. – A. Dziedziczak May 5 '17 at 12:08
  • I don't think you can do that. You must have simultaneously space for both the archive, and the result of the extraction. The only possible solution is get another storage to store your extracted tar. – Vylix May 5 '17 at 12:18

Use selective extract and selective delete.

$ tar xvf files.tar files/test.txt files/test.txt

$ tar --delete --file=files.tar files/test.txt

Given your space, splitting the extraction process into 4 should do.

The condition for this to work is that the archive is not solid.

  • Ok I understand what this will do but if it's .tar.bz2 file then it's solid? Is there a way to check it? – A. Dziedziczak May 5 '17 at 12:16
  • If the archive is solid and you try to extract a specific file, all files up to that file will have to be read until the required file is reached. How this case is handled varies a little depending or archiver type/version, but selective extraction will not work because all the previous files are practically needed to be able to extract any of next ones. – Overmind May 8 '17 at 6:10

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.