Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 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.

share|improve this answer

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

share|improve this answer
    
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. –  ErickPetru Sep 14 '12 at 0:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.