In continuation to Failure to resize a virtualbox volume I used the following commands in order to increase the space available in my virtual machine (Ubuntu):
VBoxManage.exe clonehd "c:\users\a_b\VirtualBox VMs\MyBox_default_1510839571239_2193\Box1.vmdk" "C:\Users\a_b\VirtualBox VMs\MyBox_default_1510839571239_2193\clone.vdi" --format vdi
VBoxManage.exe modifyhd "c:\users\a_b\VirtualBox VMs\MyBox_default_1510839571239_2193\clone.vdi" --resize 102400
VBoxManage.exe clonehd "c:\users\a_b\VirtualBox VMs\MyBox_default_1510839571239_2193\clone.vdi" "C:\Users\a_b\VirtualBox VMs\MyBox_default_1510839571239_2193\Box2.vmdk" --format vmdk
No errors were outputted in the process. However, neither the size of clone.vdi nor Box2.vmdk files was increased to 100GB (that should probably have been my first clue that something was amiss).
I replaced Box1.vmdk with Box2.vmdk as the storage accessed by the VM using the VirtualBox GUI.
When I activated and entered the VM via Vagrant, I checked it size using
df
and saw that the space available to the VM was not increased.
Indeed the sizes available to the two VMs (before and after "resizing") was similar:
Box1:
/dev/mapper/vagrant--vg-root 39625324 13644568 23944840 37% /
Box2:
/dev/mapper/vagrant--vg-root 39625324 13644564 23944844 37% /
How should I proceed to actually resize the VM? If the space is unavailable because the partition needs to be resized, how should I resize it?
Using
sudo resize2fs /dev/mapper/vagrant--vg-root
as suggested in https://askubuntu.com/questions/390769/how-do-i-resize-partitions-using-command-line-without-using-a-gui-on-a-server
Yields only
resize2fs 1.42.13 (17-May-2015)
The filesystem is already 498688 (1k) blocks long. Nothing to do!
And
sudo resize2fs /dev/sda1
Yields
resize2fs 1.42.13 (17-May-2015)
The filesystem is already 498688 (1k) blocks long. Nothing to do!
With no changes to size (as evident from the use of df)