Page 1 of 1

Reducing the logical size of a VDI

Posted: 13. May 2012, 19:27
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?

Re: Reducing the logical size of a VDI

Posted: 13. May 2012, 20:22
by Perryg
No you can not force it. Only safe way is to restore from backup.

Re: Reducing the logical size of a VDI

Posted: 14. May 2012, 10:14
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.