How to extend partition with free space that is before it using gparted?

I have my Windows partition (C), 9GB of free space and then I have my Linux partition. How do I expand my Linux partition with that 9GB of free space using Gparted and without losing everything I have?

enter image description here

If this is not possible, is there another tool (safer one) that I can use?


Solution 1:

###Option 1:

Moving /boot partition can render unbootable system. So, instead of moving the / (root) partition you can use the partition as a new /home partition. This link explains how.


###Option 2:

But if you want to attempt a move, make sure you are backed up and then follow the steps below:

  1. Start GParted in live Ubuntu session,

  2. If you have swap partition(s), right click on it/them and select swapoff (Edit: you can skip this as your snapshot does not show any swap used), snap1

  3. Also unmount (if they're mounted) all the partitions that will be involved in the resize/move operation (by right clicking and selecting unmount from the context menu),

  4. (WARNING: moving /boot partition may cause boot failure!) Now right click your extended partition /dev/sda2 (in your case) and select Resize/Move option, and drag the slider left to cover the unallocated space. Repeat the process with /dev/sda5 to cover the space created in the extended partiton. And then click the Resize/Move button, snap2 snap3 snapWarn

  5. After specifying such move and resize options, from the menu select Edit -> Apply All Operations or click the apply button in the toolbar. The resize and particularly move option will take a long time depending on the size of the files to be moved. So wait patiently. snap4

  6. You should then be done! Reboot to see if every thing is fine. If something went wrong and you're unable to boot, try boot-repair to fix it.

Solution 2:

Your unallocated space was just out of the extended partition.But you have an Ubuntu partition which was inside the extended partition.So follow the below steps to get the unallocated space into the extended partition and then increase the size of your Ubuntu partition.

  • Boot Ubuntu live disk and then open gparted.Make sure that all the partitions are unmounted like in the above screenshot.

  • Right-click on the /dev/sdb2 and then select Resize/Move option.Move the left arrow in the slider to the extreme left,so that the unallocated space will be get into the /dev/sdb2 extended partition.

  • Now the unallocated space was located just below to the /dev/sdb5 partition.

  • You can now be able to resize your Ubuntu partition(/dev/sdb5) by selecting the Resize option on right click /dev/sdb5 partition.