2

I was going to increase one of my VDI to 80 GB with the command:

VBoxManage modifyhd MY_DISK.vdi --resize 819200

Yes, a wrong additional zero was gone there. Of course, as an idiot I hadn't a backup.

So I really would like to decrease this size to the desired 80 GB. Unfortunatelly, just running resize again can't do it, since the --resize only increases the size.

I tried --compact too, but it only affects physical size. Is there anything can I do to change the logical size of my Virtual Box Disk Image?

2 Answers2

2

Unfortunately, I don't think there is a single VBoxManage command you can use to "shrink" the reported total physical size ("logical" as you say) of your virtual disk. Your best bet is going to be to create a new, second disk of the appropriate size, and use a disk cloning tool like CloneZilla to copy the data from the partition(s) on the first drive to your new disk.

Of course, if you are resizing the disk - that probably means it is a dynamic disk and it typically doesn't matter what the total size is - just allow the partition(s) inside the disk to be appropriately sized.

Goyuix
  • 3,164
  • 5
  • 28
  • 37
-1

I am using virtualbox 4.1.8 - For me the following steps worked - http://ubuntuforums.org/showthread.php?t=908128

  • That steps compact the physical *.vdi* size. What I need is a way to reduce the max logical size which is displayed inside the guest as the hard disk size, but no the real sized showed on the host. – Erick Petrucelli Sep 14 '12 at 00:38