Forrest logo
back to the virt-sparsify tool

virt-sparsify:tldr:009c4

virt-sparsify: Create a sparsified compressed image without snapshots from an unsparsified one.
$ virt-sparsify --compress ${path-to-image-qcow2} ${path-to-image_new-qcow2}
try on your machine

The command "virt-sparsify --compress ${path-to-image-qcow2} ${path-to-image_new-qcow2}" is used to create a new QCOW2 image file with sparse representation and compression.

Here's a breakdown of the command:

  • "virt-sparsify" is the name of the command-line tool used in virtualization environments. It is part of the libguestfs package.
  • "--compress" is an option that enables compression during the sparsification process. Compression helps in reducing the size of the resulting image file.
  • "${path-to-image-qcow2}" specifies the path and name of the original QCOW2 image file that you want to sparsify and compress.
  • "${path-to-image_new-qcow2}" specifies the path and desired name for the new QCOW2 image file that will be created as a result of the sparsification and compression process.

In summary, this command takes an existing QCOW2 image file, performs sparsification to remove unused space, and compresses the resulting image file to reduce its size. The new compressed image file is saved with the specified name and path.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the virt-sparsify tool