How to correctly repack a differencing disk image?

This is for discussing general topics about how to use VirtualBox.

How to correctly repack a differencing disk image?

Postby AnrDaemon » 17. Jul 2019, 18:26

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   Expand viewCollapse view
VBoxManage modifyhd "…" --compact
on prepared image.
AnrDaemon
 
Posts: 106
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?

Postby scottgus1 » 17. Jul 2019, 18:50

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.
Human government is like that crazy uncle who hides a quarter in his fist behind his back, then asks you to guess which fist the quarter is in...
No matter which side you choose, Left or Right, both Sides are empty.
scottgus1
 
Posts: 4066
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Win7

Re: How to correctly repack a differencing disk image?

Postby AnrDaemon » 17. Jul 2019, 19:03

I'm familiar with CloneVDI, thank you.
AnrDaemon
 
Posts: 106
Joined: 7. Feb 2010, 23:41
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu Linux, Windows


Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 19 guests