Page 1 of 1

How to correctly repack a differencing disk image?

Posted: 17. Jul 2019, 18:26
by AnrDaemon
I have a VM on hand that uses two disk images, which I want to repack[*] to reduce their on-disk size.

Data.vdi seems to be image base
Data_0.vdi reporting as "Dynamically allocated differencing storage"

I can only add the Data_0.vdi image if I add the Data.vdi first.
Now, I'd like to know how to correctly apply repack to them so to not destroy the setup completely.

* By "repack" I mean zeroing unused space on the partition and then using

Code: Select all

VBoxManage modifyhd "…" --compact
on prepared image.

Re: How to correctly repack a differencing disk image?

Posted: 17. Jul 2019, 18:50
by scottgus1
If you're set on using that command, see this post on compacting a VDI: viewtopic.php?p=29272#p29272

If you want something easier, use Mpack's CloneVDI.

Either way, as far as I have read, only the differencing image can be shrunk. The base image cannot be changed.

Re: How to correctly repack a differencing disk image?

Posted: 17. Jul 2019, 19:03
by AnrDaemon
I'm familiar with CloneVDI, thank you.