VirtualBox

Ticket #14041 (closed defect: invalid)

Opened 3 years ago

Last modified 16 months ago

VirtualBox issue after expanding and compacting .vdi file without starting vm in between

Reported by: AlexanderN Owned by:
Priority: major Component: virtual disk
Version: VirtualBox 4.3.26 Keywords:
Cc: Guest type: Windows
Host type: Linux

Description

I used Usiung VBoxManager modifyhd <file> --resize to expand a vd image and mistakenly resized at to size which couldn't handled by the disk the file is stored on. So I decided to compact the file without starting the vm (Windows 2008 R2 Server). After compacting the Disk Manager shows me and end size of nearly one TB and a used size of ~24GB. Windows itself says the disk is at the same size ~50GB as before.

I wanted to have 100 GB for the VDI and either cannot compact it nor resize tp it desired size.

Attachments

VirtualBox issue after expanding and compacting .vdi file without starting vm in between.png Download (200.4 KB) - added by AlexanderN 3 years ago.
VirtualBox issue after expanding and compacting .vdi file without starting vm in between

Change History

Changed 3 years ago by AlexanderN

VirtualBox issue after expanding and compacting .vdi file without starting vm in between

comment:1 Changed 3 years ago by frank

Sorry, I don't see the problem. What is the size you actually set your VDI? Is that ~1005GB? The disk manager shows the final size of the disk as 1005,86 GB. Currently there are 22,34GB used. Windows shows 49,90 GB - 7,63 GB = 42,27 GB of allocated disk space. I'm not 100% sure but I think it's possible that after you compacted the disk, some space is freed from the virtual disk because this space contains only zeros. Windows will still report this space as allocated. Once Windows would alter at least one bit of such a section, the complete unit (1 MB with VDI) is allocated and the current disk size in the disk manager will increase but the size of this unit.

comment:2 Changed 16 months ago by aeichner

  • Status changed from new to closed
  • Resolution set to invalid

Not a bug, compacting an image doesn't change the virtual size but as Frank pointed searches for blocks containing only 0s and frees them on the host. There is currently no way to decrease the reported size of a disk image but as long as you don't change the size of the partitions in the guest the disk image will not grow.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use