5

I am in a frustrating situation - no matter how I try, gparted won't let me assign the empty space to the first partition:

image description

The middle partition is blocking me from expanding /dev/sda1. I need to move partition /dev/sda2 to the end of the drive, like so (fabricated image):

image description

Then I will be able to expand first partition:

image description

How to do that? I assume data from /dev/sda2 must be physically copied to end of the drive.

7

Before you start, both partitions will need to be unmounted– if you cannot unmount one of them (e.g. because it is your root partition), use a live CD with GParted (e.g. the GParted live CD or the Ubuntu live CD) and resize them that way.

Select the second (extended) partition, and click on Resize/Move. Use the right handle to extend the partition to the end of the free space, and then click on Resize/Move. Select the contained swap partition, and click on Resize/Move. Drag the partition to the end of the extended partition, and then click on Resize/Move. You can safely click OK on this warning message, as we are only moving a swap partition. Warning message: "Moving a partition might cause your operating system to fail to boot[. ...] Failure to boot is most likely to occur if you move the GNU/Linux partition containing /boot, or if you move the Windows system partition C:. [...]" Select the extended partition again and click on Resize/Move. Use the left handle to shrink the partition to the end of the free space, and then click on Resize/Move. Then, select the first partition, and click on Resize/Move. Use the right handle to extend the partition to the end of the free space, and then click on Resize/Move. Finally, click on Apply and your partitions should be reformatted.

  • 2
    +1. also, gparted.org has a downloadable CD / USB image that can be used. – cas Mar 24 '16 at 2:28
  • Good point - might be more suited for this job – Joe Mar 24 '16 at 17:08
  • How to do the same with text mode parted or any other console tool ? – frytaz Oct 2 '18 at 21:20
  • Thanks for the great tutorial! I don't think I would have been able to figure this out on my own. – Michael Burr Feb 22 at 3:56

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.