James's Ramblings

qcow2

Created: May 23, 2020

qcow2 files are sparse, which means they have sections of zeroes that exist as metadata. The sections of zeroes exist logically but not physically.

  • ls returns a logical view by default. Adding the -s flag without -l for the physical view.

  • df and du return a physical view by default.

  • cp does not preserve the sparseness by default. The flags --sparse=auto or --spare=always will cause cp to preserve sparseness.

  • rsync has similar bevahiour and requires --sparse/-S to preserve sparseness.

To restore the spareseness of a file copied incorrectly: ``` fallocate -d FILE ``