I needed to add some storage on a shell only Ubuntu Linux Virtual Machine and due to having more experience with RedHat and via GUIs along with there being little information out there I thought it would be worth putting up a post for posterity.
How to add storage to your Ubuntu Linux Virtual Machine
So first step lets shut down and increase the VMDK
First Step Shut Down Guest OS
Now lets edit the Ubtuntu Linux Virtual Machine settings.
In the settings lets increase Hard Disk 1 on this Virtual Machine.
Lets go ahead and turn on the Virtual Machine again and then we can SSH into the Virtual Machine once it is back online.
(you could also take a snapshot at this point just in case)
Now onto the in-guest re partitioning bit.
First lets resize sda2 to use the extra space. On Ubuntu this is done using the command.
In here we select sda2 and then select [ Resize ] and enter the new desired size. By default it will suggest using all available space
Once this is done you will see the new size, and from here you need to [ Write ] the change and type “yes”
Now you can go ahead and [ Quit ] cfdisk.
Here is another difference with RedHat, we must now run.
sudo resize2fs /dev/sda2
If you run df -h you will see that /dev/sda2 is now using the increased size.
And we are done. If you took a snapshot don’t forget to go ahead and remove it.