Resize the virtual HDD to _smaller_ size

This is for discussing general topics about how to use VirtualBox.
Post Reply
Passiday
Posts: 32
Joined: 30. Jun 2009, 23:16
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP

Resize the virtual HDD to _smaller_ size

Post by Passiday »

Hello,

I've made mistake when creating the VM, and created much larger HDD than it's actually needed. Though it's the dynamically expanding type, I don't want to see this VDI file growing and growing larger uncontrollably. It was created as 510GB disk, but I need it to be only 50GB. Right now the VDI file is 5.16GB.

There are numerous topics online how to clone the virtual disk to a larger one, but my need to switch to a smaller one seems to be unpopular :) I don't want to screw up things, so I decided I better consult on this board how to do this properly.

Thanks,

Passiday
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Resize the virtual HDD to _smaller_ size

Post by mpack »

Use gparted to reduce the partition size, then forget about it. The drive size will not matter after that - the OS filesystem can't grow beyond the partition size, but the extra disk space is available to expand into (using gparted again) if you ever need it.
Passiday
Posts: 32
Joined: 30. Jun 2009, 23:16
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP

Re: Resize the virtual HDD to _smaller_ size

Post by Passiday »

Brilliant!

Worked like charm! Thanks!

Passiday
Post Reply