osp4 icon indicating copy to clipboard operation
osp4 copied to clipboard

Investigate if the disk image can be further compressed sparisfied

Open anjannath opened this issue 6 years ago • 5 comments

maybe people have already tried this, the tar ball now is 2.6GB if we can compress the disk image and then further tar ball it, is there a chance to decrease the size?

http://libguestfs.org/virt-sparsify.1.html

cc @praveenkumar

anjannath avatar Apr 08 '19 06:04 anjannath

I've just done this testing Initial image: 3164378298 bytes Image compressed with tar zcSf after running virt-sparsify: 2521593147 bytes (20% size reduction) Image compressed with tar JcSf after running virt-sparsify: 1695649012 bytes (45% size reduction)

The xz compression of the last image took a really long time, I did not compare decompression times.

cfergeau avatar Apr 09 '19 09:04 cfergeau

@cfergeau Do we have to expand the disk again after extracting the tar ball, or it can be used like that?

anjannath avatar Apr 09 '19 10:04 anjannath

Decompression times are comparable between the current tarball and the xz compressed one:

$ time gunzip -k ./crc_libvirt_0.16.1.tar.gz
real	1m40.757s

$ time xz -d -k ./crc_libvirt-sparse.tar.xz^C
real	1m53.299s

cfergeau avatar Apr 09 '19 12:04 cfergeau

@anjannath there is no additional step needed, you uncompress the tarball, and can use it as is.

cfergeau avatar Apr 09 '19 12:04 cfergeau

I've now tested the image I got out of virt-sparsify, and did not notice any issues with it.

cfergeau avatar Apr 10 '19 08:04 cfergeau