How to correctly repack a differencing disk image?

This is for discussing general topics about how to use VirtualBox.
Post Reply
AnrDaemon
Posts: 134
Joined: 7. Feb 2010, 23:41
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu Linux, Windows

How to correctly repack a differencing disk image?

Post 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.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to correctly repack a differencing disk image?

Post 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.
AnrDaemon
Posts: 134
Joined: 7. Feb 2010, 23:41
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu Linux, Windows

Re: How to correctly repack a differencing disk image?

Post by AnrDaemon »

I'm familiar with CloneVDI, thank you.
Post Reply