Howto resize a Dynamical VirtualBox Disk with a Linux-Guest

Howto resize a Dynamical VirtualBox Disk with a Linux-Guest

By SolarEclipse | SolarEclipse | 29 Mar 2020


If you want to resize a VirtualBox Disk on a Windows-Host with a Linux-Guest (with LVM-Disks) follow the following steps:

Check the type of your Disk, it must be dynamically allocated storage

351665157-9ee562b2aa86c7f207e58b4ddecf4e09970c4d71c6f0b677c1cf0baa4a70bffe.png
Actual size of the Disk = 117.56GB

  • Insert a SystemRescueCd Live Image into the CDROM of your Linux-Guest-VM
  • Boot up your VM
  • Detect all available partitions and LVM-Volumes
    • fdisk -l

351665157-7783a7da2be5315d65173ddf6ce045bea5b39c63499ae3cc8fdcb25c384f73d6.png

  • Empty space by overwriting with zeros with the tool zerofree in every detected partition and LVM-Volume.
    • zerofree -v /dev/mapper/ubuntu--vg-root

351665157-6bcb1040890da5592b580772e04e8123dbc03f1af18f7ce5ebfa5a73eeabead8.png

  • Shutdown your VM and open your cmd.exe on your Windows-Host. Change to the directory of your VirtualBox installation folder.
    • VBoxManage.exe modifyhd --compact "C:\Path\to\your\vdi-file.vdi"
  • Done

351665157-632131b87700a0ab7703db446be3893928cae73cbf1e3eff1c3213222e70f344.png
New size of the Disk 34.76GB

Success!!

 

How do you rate this article?


2

0

SolarEclipse
SolarEclipse

Believing that crypto is changing our world. To the better or to the worse? We will see!


SolarEclipse
SolarEclipse

In this blog, I write about my findings in the crypto world.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.