I use VirtualBox on Windows 10 to run a VM using Ubuntu 16.04.1 LTS.
I got the VM from my University with a disk size of 20GB which was way to optimistic ... so I want to resize it to 50GB
so I already did
- (on the host) Make a BackUp ;)
- (on the host) VBoxManage clonehd "source.vmdk" "clone.vdi" --format vdi
- (on the host) VBoxManage modifyhd "clone.vdi" --resize 51200
- (on the host) Downloaded GParted.iso
- (in the VM) Booted into GParted
- (in the VM) Expanded The Swap from 2GB to 4GB according to the RAM of the VM I also changed
Now I see the following image As you can see obviously the new diskspace got added at the end of the disk. But now I'm facing the problem that I cannot expand the primary partition because the swap partition is "in the way". I neither am able to move the swap-partition.
How can I expand the primary partition and/or move the swap partition to the end of the disk?
The Idea I had was:
- Create new Partition
/dev/sda2with file format
linux-swapand the end of the disk
/dev/sda1to use the rest of the disk
Is this the way to go? Will Ubuntu automatically "know" where the swap partition will be after this action?