Truncate VHD image?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
m880
Posts: 2
Joined: 29. May 2013, 00:00

Truncate VHD image?

Post by m880 »

Hi,

I was given a RAW full disk image of a 500gb HDD. I've used vhdtool /convert to make it a vhd file to load into a Virtualbox VM. The image is only about 125GB full and the rest is just taking up space. I'm not concerned with forensic recovery or 'undelete' operations, just the files currently visible or necessary to the OS.

Could anyone recommend a way to cut the empty space from the 500GB vhd image leaving only a 125GB image?

Any help would be appreciated. Thanks!
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Truncate VHD image?

Post by mpack »

You could have just converted the raw file directly to VDI using CloneVDI, with compaction enabled so the unused space is ditched. You can still do the the same from the VHD.
m880
Posts: 2
Joined: 29. May 2013, 00:00

Re: Truncate VHD image?

Post by m880 »

Worked perfectly.

Thanks for releasing such a great tool!
Post Reply