1

I'm on Ubuntu 15.10. My current partition state is as shown in the image.

enter image description here

I had Ubuntu 12.04 installed on a 19.22 GB partition, and I removed it and deleted the partition. Now I want to extend /dev/sda2 to include the 19.22 GB unallocated space that's right after it. However, GParted won't let me do that.

I think it has something to do with the hierarchical way the partitions are presented (the unallocated space seems to be a part of /dev/sda4 somehow), but I have no idea how to solve this.

  • 1
    You cannot do that from within your installed Ubuntu system, because it require modifying the partition on which it is installed. Try from a Live CD. – fkraiem May 12 '16 at 16:59
  • @fkraiem but ubuntu is installed on sda5. I want to extend sda2. – hoodakaushal May 12 '16 at 17:01
  • 1
    /dev/sda5 is located inside the extended partition /dev/sda4, and you need to shrink /dev/sda4. – fkraiem May 12 '16 at 17:02
  • There's no easy way to do this. The unallocated space is indeed within the extended partition. You would need to backup ext4 to external media, boot a live medium, swap off sda6, delete sda6 and sda4, extend sda2, then remake your extended partition and reinstall ubuntu to it. – chaskes May 12 '16 at 17:08
  • 1
    This is a bad idea. The unallocated space is inside an extended partition, and can not be easily merged to sda2. – mikewhatever May 12 '16 at 17:08
2

In order to grow primary partition sda2, the unallocated space must be immediately adjacent. Currently it is within extended partition sda4.

The steps are:

  1. Boot from live media containing GParted, e.g. GParted Live.
  2. Shrink extended partition sda4 to butt up against sda5.
  3. Grow primary partition sda2 into the adjacent unallocated space.

See also Moving Space Between Partitions

| improve this answer | |
1

/dev/sda4 is an extended partition where your free space is and what has been a logical partition. /dev/sda2 is a primary partion. You could merge the space with /dev/sda5 (and /dev/sda6) if you boot from a Live-CD/DVD/USB as fkraiem has already told.

You cannot "move" the space from an extended partion to a primary one. Have a closer look at https://en.wikipedia.org/wiki/Disk_partitioning.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.