Move free space from end of the drive to first partition with gparted
It is recommended that, before making any changes, you make backups of any data you do not want to lose in case anything goes wrong.
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. 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.
Related videos on Youtube
Tomáš Zato - Reinstate Monica
It might be easier to hire new management than to get a new community of volunteers. - James jenkins If you play League of Legends, check my repository: http://darker.github.io/auto-client/ I no longer play and I am actively looking for someone to maintain the project. It helped thousands of people, literally.
Updated on September 18, 2022Comments
-
Tomáš Zato - Reinstate Monica over 1 year
I am in a frustrating situation - no matter how I try, gparted won't let me assign the empty space to the first partition:
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):Then I will be able to expand first partition:
How to do that? I assume data from
/dev/sda2
must be physically copied to end of the drive. -
Alessio about 8 years+1. also, gparted.org has a downloadable CD / USB image that can be used.
-
Joe about 8 yearsGood point - might be more suited for this job
-
frytaz over 5 yearsHow to do the same with text mode parted or any other console tool ?
-
Michael Burr about 5 yearsThanks for the great tutorial! I don't think I would have been able to figure this out on my own.