gparted: how to merge unallocated space with a partition
That's because you have unallocated space outside of the extended partition (sda3
) which contains the partition you want to extend (sda5
) so I would:
- Take a full system backup using CloneZilla Live¹
- Boot a live environment of gparted
- Move
sda3
to the left (this will move bothsda5
andsda6
as well) - Extend
sda3
with the now free space at the end - Move
sda6
to the end ofsda3
- Extend
sda5
still leaving 10% of the disk space unallocated betweensda5
andsda6
²
Note 1: Yes, take a backup! If you have a power failure in any of the following steps, your entire disk is toast!
Note 2: That leaves you some wriggling room to extend your swap or your data (or both) in an emergency.
Note 3: Yes, you can also extend sda3
to the left and then extend sda5
to the left but that will not give you the 10% spare (unallocated) space for emergency extension in the future and the entire process is going to take all night anyway.