Reducing the logical size of a VDI

Discussions about using Windows guests in VirtualBox.
Post Reply
stdunbar
Posts: 1
Joined: 13. May 2012, 19:22

Reducing the logical size of a VDI

Post by stdunbar »

Hi all,
In an attempt to give myself some more space on my Ubuntu hosted Windows 7 VM I ran:

Code: Select all

VBoxManage modifyhd "Windows 7.vdi" --resize 67108864
Now I have an unusable 64TB (!) disk. I tried to resize it back down:

Code: Select all

VBoxManage modifyhd "Windows 7.vdi" --resize 65536
but get:

Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!

I have been unable to boot into Windows 7 now and, yes, I realize that reducing a hard drive could cause corruption but since the Windows 7 O/S won't boot if I could just reduce it to, say, 64GB (it was 32), then I'm confident that fdisk can handle the rest.

Is there some way to force the modifyhd command to run even if it isn't a good idea?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Reducing the logical size of a VDI

Post by Perryg »

No you can not force it. Only safe way is to restore from backup.
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: Reducing the logical size of a VDI

Post by mpack »

On the remote chance that you are desperate but somehow don't have a backup, you might want to read this older thread from the last guy who made this mistake, discussing fixes. It includes instructions in how to patch the header to repair the damage enough to use the disk. You should then clone the disk with CloneVDI to get a complete repair.
Post Reply