5 ms·
It might be easier to do this with the qcow2 disk image format. Compression is enabled individually for each cluster (see bit 62 of the L2 table entry). That wa
by stefanha 4y ago
It might be easier to do this with the qcow2 disk image format. Compression is enabled individually for each cluster (see bit 62 of the L2 table entry). That way an image can have mixed uncompressed and compressed clusters without requiring a CRC update after modification.
The data layout within the file can be queried with "qemu-img map file.qcow2" so you know the offsets where uncompressed data can be overwritten (if you want to patch it from the host instead of from inside a virtual machine).
- rwmj 4y agoPrefixed by saying this is indeed a good approach, I did just want to point out some potential issues: - Clouds don't universally support qcow2 (or even worse, use their own implementation which isn't feature-complete) - Probably a per-cluster compressed qcow2 isn't ever going to be as small as a qcow2.xz file. [Edit: deleted a bogus third point here about making these files, no special tools are needed to create or modify compressed qcow2 files]