Delete original tar after untar? Not enough space to untar
I have a 130GB tar file I need to untar to /storage.
Problem is, I don't have enough disk space for both to exist at the same time. How can I untar the tar file, and ensure there is enough disk space, and delete the file immediately after untar?
Thanks.
Solution 1:
This one is hard. It really depends on how much free space you have.
Others said to extract part of the files and delete them from the tar. That's the only option I can see right now.
Updating the tar requires the tar to be reconstructed without the deleted files on the same drive. That's why you have to have 2 x tar size + something more to allow extraction of the files.
HTH
Solution 2:
If it just a tar file (i.e. not zipped) and if you have enough space left on the disk to store a zipped version of the tarball, you could try to zip this and then construct an unzip | tar
pipe. I would test this beforehand, though.
Easier solution: Get a bigger disk.
Solution 3:
Can you put the tar file on a different server? Because then, you can untar via ssh without worrying about the space taken by the original file.