Ubuntu – Resize Boot Partition Next to An Extended Partition

gpartedlive-cdpartitioning

I created 2 partitions:

  • Boot / Root (Namely /).
  • Home (/home).

I underestimated the size needed for the Boot / Root and only set it 25GB.
I now need to resize it.
I used LiveCD to run GParted and this is what I have:

enter image description here

Can anyone guide me how can I resize the partitions without loosing any data?
It seems I must delete the sdf2 partition completely which means data is lost.

Is there any other way to do it (I don't have anything besides the disks above)?
On worse case scenario I don't mind losing all data on /home but I want the system to work as before.

Please guide me and remember those are my first steps in the Linux World.

Thank You.

Best Answer

  • Boot from a live CD to perform the partitioning operations. This is necessary because partitions can't be shrunk or moved while they are mounted. It also reduces the risk of data loss.

    Also make sure that you have a backup of everything important before you start. Normally it's pretty safe, but partitioning can sometimes fail and cause data loss. Prepare yourself or continue on your own risk.


    1. Now in GParted from the live CD, shrink sdf5 by moving its left border to the right by the amount you want to grow your root partition.

    2. Then do the same with the extended partition container sdf2 that is enclosing your home partition, so that there is no more unassigned space left inside of it.

    3. After that, you can finally grow the root partition sdf1 by moving its right border to the right until all unpartitioned space is gone.

    screenshot taken by Royi


    It shouldn't take that long though. Your home only contains few data and ext4 starts writing near the middle of a partition anyway, unlike FAT or NTFS, so probably it barely as to move any real data there. Growing should also be fairly quick. I'd assume a runtime of many minutes to few hours at most.