When you want to resize any partition in Ubuntu, whether shrinking it or enlarging it, or divide it into number of partitions, you won't be able to do it while it is being used. It requires an Ubuntu live CD or USB stick to adjust the partitions.
The Ubuntu live CD comes with a partition editor- GParted, with which you can change your partitions. GParted brings to you a partition editor with graphical user interface that acts as a front-end to various terminal commands.
Creating Ubuntu Live Media
First of all you will need an ISO image of Ubuntu, which you can download from here. To create Ubuntu live CD, insert the disc in your system, right-click the downloaded file and select "Write to Disc" option.
If you wish to create bootable USB drive, you can either use UNetBootin or Startup Disk Creator application present in Ubuntu Dash.
Provide the necessary information about Ubuntu ISO file and USB drive in Startup Disk Creator application and it will start creating Ubuntu live USB drive for you.
Insert the Ubuntu live media into your computer and reboot. Check the BIOS settings and adjust the boot order so that it will boot from the Ubuntu live media.
GParted utility doesn't come as a pre-installed package in Ubuntu system, but it is present in the Ubuntu live environment. Get started with GParted by launching it from the Ubuntu Dash.
Select the appropriate partition of your computer from the drop-down menu located at top-right corner of the GParted window.
You won't be able to modify the partitions while they are being used – such partitions will be indicated by a key icon present in front of them. Unmount the partition by ejecting them from file manager. Ubuntu live will enable swap partitions in your computer it. To disable those swap partitions, right-click and choose Swapoff.
In order to resize any partition, right click on it and choose "Resize/Move"
An easy and sophisticated way to resize a partition is to click and drag the sliders on both sides. You may provide the required partition size in terms of exact numbers. Partition can be shrunk if it has free space available.
Every modification you do will be lined-up in a queue which is listed at the bottom of the window. No modification will be activated instantaneously.
After shrinking a partition, the free "unallocated" hard drive space left behind can be transformed into a new partition.
If there is an unallocated space adjacent to any partition,you can enlarge the partition by merging the free space into the partition. Simply right click the free space and select Resize/Move.
As mentioned above, you can determine the newly formed partition size by adjusting the sliders or entering the numbers.
Once you are done with partitioning, click the green check mark to apply the operations.
Before you resize any partition, it is always important to have backup of all the data within the partition. It may happen that you may lose your crucial data in the proceedings.
When you click Apply, it will start processing your modifications and after some time, your changes will take effect permanently.
When everything is finished, remove the bootable media and restart the system.