Hello
I am posting my solution here. I would like to see a script that actually does this.
Code:
#How to extract a tar archive on a disk when booth the archive and
# extracted data will not fit on the disk at the same time.
#
# There are situations where one wants to extract a large archive that is
# already stored on the disk to the same storage. If
# in such a situation booth the large archive and the extracted files will
# not fit you are in a situation where you can not simply
# extract the archive.
#
# The proposed solution here is to first split the archive into smaller
# chunks and then extracting the archive via stdin while removing the chunks.
# *Note that this is a destructive method*
#
# First step is to split the archive into chunks. We can not use the
# "standard" split command because this will keep the original file while
# creating the chunk. We will be splitting the file in chunks from the end and
# will truncate the file. This can probably be done using the dd tool.
chunk_size = ( This size should be smaller then the expected free space \
after removal or the archive and installation of the archive content)
while(file != empty)
do
get a chunk_size section from the end
truncate the file
done
#after that cat all the files to stdout and pass this to tar
(
for i in files.chunks
do
cat $i
rm $i
done
) | tar xvf -