I wanted to archive virtual disk files, that are created as sparse files using tar. However, this doesn't seem to work out. When I use this command:
tar -Scvf - ../VirtualDisks/0004fb0000120000162258109df6973d.img , where 0004fb0000120000162258109df6973d.img is a non-sparse file, imported via OVMM into the repository, I am getting the expected output to stdout, good.
But, if I use the same command on any sparse file, I am getting no output at all, regardlessly of how long I let it run.
Actually… this works, but it seems that this is useless for very big files as well. It seems that I was too impatient and tar needs to read the whole file to if you issue a -S.
I tried that on a sparse file that was 100GB in size, but had only occupied 12 GB on the storage and after approx. 30 mins. tar had created the actual archive, where in the first 25 mins. nothing seemed to happen at all.
Then I tried that again with a 2.8 TB sparse file, which occupies 543 GB on the storage and got this:
[root@oraclevms05 VirtualDisksSnapshots]# time tar -Scvf - ../VirtualDisks/0004fb000012000023e2fb511eb5231c.img | gzip -9 > 0004fb000012000023e2fb511eb5231c.img.tar.gz
tar: Removing leading `../' from member names
tar: memory exhausted
tar: Error is not recoverable: exiting now
So, after 12 hrs tar ran out of memory and thus this won't work for very large files, I guess…