3

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.

Byte Commander
  • 110,523
Royi
  • 155
  • 2
    Presumably resizing sdf5 first will then allow you to resize sdf2, when that's done you should be able to drag the slider between them to make sdf1 bigger at the expense of sdf2. Worst case, these kinds of operations can take hours or even days depending on the amount of data needing to be moved. If you can deal with it, wiping the disk and re-doing everything may be the quickest option. – pzkpfw Jul 14 '17 at 20:53
  • @pzkpfw, No GParted won't allow doing what you're suggesting. Namely moving the beginning of sdf5 to the right won't allow sdf1 to get bigger (This is what I thought at first, yet it seems not trivial). – Royi Jul 14 '17 at 21:20
  • 3
    As mentioned by @pzkpfw, boot from a live CD, shrink sdf5 by moving its left border to the right by the amount you want to grow your root partition. 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. After that, you can finally grow the root partition sdf1 by moving its right border to the right until all unpartitioned space is gone. – Byte Commander Jul 14 '17 at 21:22
  • 1
    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. – Byte Commander Jul 14 '17 at 21:25
  • @ByteCommander, Would you write this as an answer? – Royi Jul 14 '17 at 21:33
  • @Royi Okay, there you go. I reused the nice screenshot from your self-answer if you don't mind. – Byte Commander Jul 14 '17 at 21:43
  • @pzkpfw, Thank You. I +1 your comment. – Royi Jul 14 '17 at 21:45

2 Answers2

4

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.

Byte Commander
  • 110,523
  • Perfect. I'm waiting on GParted to do its charm now. Hopefully all will be good. Thank You. – Royi Jul 14 '17 at 21:44
0

It seems I missed one crucial step that @ByteCommander noticed.
I need to resize sdf5 partition (Drag its left boundary to the right) and then resize the Extended Partition Container (Colored Cyan on the screen shot and named sdf2) as well:

enter image description here

This, at least on screen, created the desired result.

@ByteCommander, please create an answer and I will mark it.

Thank You.

Royi
  • 155
  • Do you want to keep your answer there or remove it? Feel free to suggest an edit to mine if you want to include anything additional. – Byte Commander Jul 14 '17 at 21:52