- First open the VirtualBox "Manager vor virtual Drives" and disconnect the drive from any machiene
- Backup old image:
cp ubuntu-14.10-server-amd64.vdi ubuntu-14.10-server-amd64.backup.vdi
- Increase Size (in MB, here ~50 GB):
VBoxManage modifyhd ubuntu-14.10-server-amd64.vdi --resize 50000
- Reconnect the drive to your virtual machine and start it up.
- Find the main partition:
lsblk
- Run fdisk on this partition:
sudo fdisk /dev/sda
- Use
p
to list the partitions. Make note of the start cylinder of/dev/sda1
. - Use
d
to delete first the swap partition (2) and then the/dev/sda1
partition. This is very scary but is actually harmless as the data is not written to the disk until you write the changes to the disk. - Use
n
to create a new primary partition. Make sure its start cylinder is exactly the same as the old/dev/sda1
used to have. For the end cylinder agree with the default choice, which is to make the partition to span the whole disk (or e.g. 100000000=47.7GB). - Use
a
to toggle the bootable flag on the new/dev/sda1
- Review your changes, make a deep breath and use
w
to write the new partition table to disk. You'll get a message telling that the kernel couldn't re-read the partition table because the device is busy, but that's ok.
- Use
- Reboot:
sudo reboot
- Increase partition size:
sudo resize2fs /dev/sda1