So, I accidentally enlarged a 48GB .vhd disk to 120TB, instead of 120GB in Virtualbox. Realizing the error, I am now trying to bring it down to 120GB; however for obvious reason, modifyvm --resize
is not working. See error in second image. Is there anything I can do to shrink my disk image to 120GB?
Asked
Active
Viewed 469 times
2

kelvinelove
- 1,617
- 1
- 16
- 26

Sam Walton
- 21
-
is your .vhd dynamically allocated? – LittleByBlue Jul 15 '16 at 18:43
1 Answers
1
Unfortunately we can not "shrink" a virtual hard drive that we accidentally grew too much with using the VBoxManage
command.
The only means of repair would be to create a new virtual drive of appropriate desired size and copy the data over.
Still, there is no harm done on creating such a huge drive as long as we do not actually partition and use it.
The drive is of dynamically growing type as only then we can resize it at all. It will therefore not use any more physical space on the host drive than needed. Unused virtual hard drive space will not use any physical space.
In case we had partitioned and used the additional space we may be able to compact it again as shown in this answer.