Resiszing the disc was easy:
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd Ubuntu.vdi --resize 16000
But how make the guest system effectively use the additional space, if the disc is used with LVM? It took me some time to understand that several steps are needed due to the layered architecture of LVM. Execute following steps as root
- Create a new logical partition with fdisk and give it type 8e (sda is the device name under which Ubuntu recognizes the disk)
fdisk /dev/sda
- Create a physical volume from the new partition (sda6 is the device name for the new partition)
pvcreate /dev/sda6
- Add the new physical volume to a volume group (ubuntu is its name, you can find it out with vgdisplay)
vgextend ubuntu /dev/sda6
- Extend the logical volume with the space now available (/dev/mapper/ubuntu-root is the path of the logical volume)
lvextend /dev/mapper/ubuntu-root /dev/sda6
- Make the file system aware of its new dimension
sudo resize2fs /dev/mapper/ubuntu-root


