Here I cover resizing lubuntu (14.04.2) linux as guest OS on virtual box. I am using Mac OSX as a host OS.
First we have a 15gb virtual box (vdmk) image file in virtualbox. If you are paranoid, just to be safe, clone the virtualbox VM by right clicking and clone.
1) Convert vdmk to vdi using this command:
> cd ~/VirtualBox VMs/
> cd mylubuntubox/path/
> VBoxManage clonehd MyLubuntuBox.vmdk lubuntubox.vdi –format vdi
2) Resize the vdi clone
> VBoxManage modifyhd lubuntubox.vdi –resize 25600
3) Download gpartlive iso here: http://gparted.org/download.php
4) In the virtualbox gui, click on settings and change the HDD to lubuntubox.vdi
5) Add a boot CD as gparted.iso (the iso you downloaded)
6) Start the virtualbox VM and you should get into GPARTed.
7) Resize the Partition to the full size, which covers the unused XXXXGB.
If there is a lock on the partition, right click and deactivate, then resize. Afterwards just, reactivate.
Your system will not reflect the full extended size if you used LVM (logical volume management). The partition will be 25gb however the sdx contains root(LV) and swap(LV). You need to extend the root (LV)
8) Download and mount lubuntu 14.04.2 (live cd here) PC 64 bit ISO
https://help.ubuntu.com/community/Lubuntu/GetLubuntu/LTS
mount the Lubuntu iso (like how you mounted gparted iso above) and reboot into Lubuntu Live
10) install the LVM2 system-config-lvm gui to resize the LVM (if you have used LVM in your resize)
> run lxterminal
> sudo add-apt-repository ‘deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe’
> sudo apt-get update
> sudo apt-get install system-config-lvm
> sudo system-config-lvm
11) now click on root(LV) and click on the button ‘use remaining space’.
12) save and reboot. Good luck.
Reference:
- http://stackoverflow.com/questions/11659005/how-to-resize-a-virtualbox-vmdk-file
- http://www.convertunits.com/from/gigabyte/to/MB
- http://www.howtogeek.com/127246/linux-sysadmin-how-to-manage-lvms-with-a-gui/
- http://askubuntu.com/questions/196125/how-can-i-resize-an-lvm-partition-i-e-physical-volume