crc-org / osp4

Proof of Concept repository of CodeReady Containers [Archived]
Apache License 2.0
26 stars 16 forks source link

Investigate if the disk image can be further compressed sparisfied #54

Open anjannath opened 5 years ago

anjannath commented 5 years ago

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

cfergeau commented 5 years ago

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.

anjannath commented 5 years ago

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

cfergeau commented 5 years ago

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 commented 5 years ago

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

cfergeau commented 5 years ago

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