This discussion is archived
3 Replies Latest reply: Dec 9, 2012 10:36 AM by J Peters RSS

archive sparse files using tar doesn't seem to work

budachst Pro
Currently Being Moderated
Hi,

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.

Anybody tried that yet and succeeded?
  • 1. Re: archive sparse files using tar doesn't seem to work
    J Peters Newbie
    Currently Being Moderated
    That is interesting create a "sparse" archive of a non-sparse file.

    "-S" just handles sparse "efficiently".

    [root@ovm311 ~]# tar -? | grep -- -S
    -S, --sparse               handle sparse files efficiently                                                                                                                                                                                                                                                                                                                                                                                                                                       
  • 2. Re: archive sparse files using tar doesn't seem to work
    budachst Pro
    Currently Being Moderated
    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

    real 724m12.093s
    user 32m9.143s
    sys 204m48.014s

    So, after 12 hrs tar ran out of memory and thus this won't work for very large files, I guess…
  • 3. Re: archive sparse files using tar doesn't seem to work
    J Peters Newbie
    Currently Being Moderated
    Very cool, thanks for sharing. The OVM JeOS for Dom0 is usually not "large" by design.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points