1

How to merge this unallocated space to my root partition.

enter image description here

guntbert
  • 13,134
brows
  • 11

1 Answers1

1

First of all, editing partitions always comes with the risk of data loss, so please back up your system first. If you use a laptop, make sure your power supply is connected properly, you don't want to run out of battery while performing such actions.

You can't edit partitions while they are mounted, so you have to boot from your installer medium (USB,DVD) and choose the Try Ubuntu without installing option. Then open GParted. Now perform the following steps:

  1. Select the swap-partition sda6 with a right-click and choose swapoff
  2. Select the extended partition sda2 with a right-click, choose Resize/Move and increase the size of this partition to the right.
  3. Select the swap-partition sda6 with a right-click, choose Resize/Moveand move the partition to the right.
  4. Select the data-partition sda5 with a right-click, choose Resize/Move and move the partition to the right. This will take some time, 66GB of data have to be moved, be patient.
  5. Select the extended partition sda2 with a right-click, choose Resize/Move and decrease the size of this partition on it's left end.
  6. Select your system-partition sda1 with a right-click, choose Resize/Move and increase the size of the partition to the right.

After each step click the Apply-button (the small green check-mark in GParted's toolbar).

mook765
  • 15,925
  • +1. This should work but there is a risk, which you say. So there should be a backup. And if there is a backup (backed up files), I think it would be easier and faster to remove the content of the extended partition, and then the extended partition will be very easy to shrink and/or move and use the created unallocated space near the root partition to grow that partition. Afterwards it is easy and fast to create logical partitions again and copy back the data. The swap partition can be created (and needs no restore of data). But make its UUID match the swap line in the file /etc/fstab. – sudodus May 16 '18 at 19:53