Source
VBoxManage modify vdi VDINAME compact
Make sure that all unused sectors are zeroed, otherwise you won't gain much. Note that this currently cannot effectively operate on disks which have snapshots, it can only compact the base image but not the diff image(s).
As "VBoxManage modifyvdi VDINAME compact" does only release zeroed sectors, we need a tool to fill unused sectors of a file system with zeros, e.g. for an NTFS partition.
Check out the "-z" parameters of SysInternals? SDelete:
http://www.microsoft.com/technet/sysinternals/fileanddiskutilities.mspx
Accessing VirtualBox VDI Disks on the Host Computer Please note! This only works for fixed sized virtual disks! Also, don't mount the virtual disk on the host when the guest is using it!
....
Easily increase your VirtualBox VDI size
VBoxManage modify vdi VDINAME compact
Make sure that all unused sectors are zeroed, otherwise you won't gain much. Note that this currently cannot effectively operate on disks which have snapshots, it can only compact the base image but not the diff image(s).
As "VBoxManage modifyvdi VDINAME compact" does only release zeroed sectors, we need a tool to fill unused sectors of a file system with zeros, e.g. for an NTFS partition.
Check out the "-z" parameters of SysInternals? SDelete:
http://www.microsoft.com/technet/sysinternals/fileanddiskutilities.mspx
There is a simple way to do this on a Linux partition. Simply use the dd tool. i.e.
dd if=/dev/zero of=/fillerup.zero
then remove the /fillerup.zero file and it's done.
Although it is a somewhat roundabout way, it works quite well: Create a new VDI-drive of the desired size and then add it as second disk to the system to be resized. Tie in a CD-imgage like Knoppix or Gparted and launch the system. Then simply use dd or ddrescue to transfer the system to the new drive. Of course you will also need to resize the partitions etc.
How to resize a VirtualBox disk partitiondd if=/dev/zero of=/fillerup.zero
then remove the /fillerup.zero file and it's done.
Although it is a somewhat roundabout way, it works quite well: Create a new VDI-drive of the desired size and then add it as second disk to the system to be resized. Tie in a CD-imgage like Knoppix or Gparted and launch the system. Then simply use dd or ddrescue to transfer the system to the new drive. Of course you will also need to resize the partitions etc.
Accessing VirtualBox VDI Disks on the Host Computer Please note! This only works for fixed sized virtual disks! Also, don't mount the virtual disk on the host when the guest is using it!
....
Easily increase your VirtualBox VDI size
No comments:
Post a Comment