1

I have 1TB HDD in which 755 GB is Win 7 and 164 GB is ext4 partition out of which 60 GB has Ubuntu OS on it.

A small history: I had dual booted a while ago with windows 7 on my laptop, such that I had taken 64 GB from windows 7 partition and installed Ubuntu in this. Out of this 64 GB, 4GB was given to swap and then rest 60 GB was where the Ubuntu system directory resides.

Sequentially the drives were marked as (inside gparted live):

Win7 ---> ext4(/dev/sda4[this 64 GB])

Now ext4 is divided into two logical partition

  • /dev/sda5 (4GB) [SWAP]
  • /dev/sda6 (60GB)

Today due to lack of space in ubuntu partition I decided to expand its space, by first resizing the big Win7 partition and taking 100 GB from it and then formatting the resultant unalloacted 100 GB to ext4 partition, and thus was create /dev/sda7 (100 GB) as another logical partition inside /dev/sda4 (which is now 164 GB)

So logically inside /dev/sda4 the partitions are

/sda7(100GB) --> /sda5(4GB)[SWAP] --> sda6(60GB)

NOW, Gparted was not able to merge /sda6 and /sda7 due to swap in between them and as a result I formatted swap to ext4

/sda7(100GB) --> /sda5(4GB)[NO MORE SWAP] --> sda6(60GB)

Here is a screenshot:

Gparted screenshot

The problem is Gparted is still not able to merge any of these logical partition together as you can see when i click on /sda6 to resize

NO SPACE IS SHOWN BEFORE IT TO  EXPAND

2
  • First you have to unmount everything, then you have to free some space on the left of sda6, since there is none. To do so, reduce sda7 (or remove it all together, since it is empty, then move the swap to the left, and finally you will be able to expand sda6 to the left. – dadexix86 Jun 22 '16 at 8:54
  • alrigh im on it – Ashish dahiya Jun 22 '16 at 21:02
0
  1. When trying to resize internal disk linux partition ALWAYS use a LiveCD/USB, because all internal partitions must be unmounted (not blocked by the installed Ubuntu). You are doing that, which is very good.
  2. In GParted, right-click on the swap partition and choose swapoff. You can't resize or move it if it's not off (unused). Then move it out of the way, reposition it before or after the ext partitions.
  3. When trying to merge (any) partitions, make sure they are of the same kind: both either primary, or both logical. To make sure you won't run into trouble, i suggest you first delete one of the two ext partitions, and expand the other to encompass the unformatted space resulted from the deletion.
2
  • thanks it worked! just one problem though , i deleted swap too when I used Gparted Live , now i have no swap but 164 GB ubuntu disk space , how do i create swap now. – Ashish dahiya Jun 22 '16 at 21:00
  • You can create swap partition in unformatted space the same way you created ext partition, but you don't format it as ext, you format it as swap. Recommended swap size is 1.5x up to 2x RAM size. Don't use oversized swap because it will eventually break the RAM memory blocks resulting in big errors. – ipse lute Jun 22 '16 at 22:33
0

You can't "merge" partitions in Gparted. You can create, delete, or resize them.

There was no need to format swap partition to ext4.

You need to unmount your sda6 partition, delete sda5 and sda7, then expand the sda6.

Consider leaving space for a swap partition and do not forget to add the new UUID of it to /etc/fstab.

Note: After you move the start of the / partition the system may not boot. You will need to re-install grub.

2
  • thanks it worked! just one problem though , i deleted swap too when I used Gparted Live , now i have no swap but 164 GB ubuntu disk space , how do i create swap now. – Ashish dahiya Jun 22 '16 at 21:00
  • You can shrink some partition and create swap on an unallocated space. – Pilot6 Jun 23 '16 at 6:31

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.