0

My GParted image:

My GParted image

I have Ubuntu on dual-boot with Windows, but I started to need more free space for Ubuntu so I shrank the Windows partition (sda2). But I can't use the unallocated space that I have now, because it`s to the left of the Ubuntu partition (sda5) and GParted doesn't allow me to extend it to the left or the right. I can only shrink the Ubuntu partition.

How exactly can I proceed in order to use that unallocated space for Ubuntu?

pomsky
  • 68,507
  • Possible duplicate: https://askubuntu.com/questions/591213/how-to-expand-resize-extended-partition – ejjl Aug 09 '18 at 18:00

2 Answers2

1

The Ubuntu partition sda5 is a secondary partition to the primary partition sda4 so you can't resize sda5 beyond the size of sda4

To resize the Ubuntu partition, you must first resize sda4 by extending it into the free space you have created. Then the next step is to extend sda5 to use up the extra spaces in sda4. You can do this in gparted and apply the change in one go.

Here are the steps:

  1. Move the sda3 partition so that the free space is after sda3 (not before it like it is shown now).
  2. Resize sda4 into the free space before it (by extending sda4). Be sure not to select sda5 by mistake as it is just an outline surrounding sda5.
  3. Lastly, resize sda5 to fill up the larger sda4 partition you have created.
  4. Now, apply the changes.

Good luck.

PS: Should backup important stuff in case things go wrong.

pomsky
  • 68,507
Bernard Wei
  • 2,125
0

First of all you can't manage Linux partitions when logged into the system, assuming you're logged in.

Second, editing/resize/move partitions in Linux can be trouble and is not without risk - just a friendly warning.

Solution: insert live cd/usb of Ubuntu with gparted installed or (best) create a gparted iso image and boot into it. Open gparted, unmount the partitions to be edited and select the partition to resize/move. Click the edge of the partition and drag it so it takes up the unallocated space.

Select Edit and Apply All Operations. Reboot, open gparted to check the partitions.

From the info you provided - hope this helps

Have fun

  • I actually used a live usb and tried to resize the edge of the ubuntu partition, like you said. But it seems the way the partitions are set up doesnt allow me to drag it in order to extend it, only to shrink it. I guess the unallocated space isnt where it should be, but I have no idea how to get it right without deleting anything. – Letícia Lima Aug 09 '18 at 18:39
  • Did you try unmounting the partitions first then try to move them. Can't edit mounted partitions. I should have included this in my answer. Be advised that moving partitions left is trouble. Be sure to Deja Dup your data on a separate drive to be safe. –  Aug 09 '18 at 19:01