How to increase the size of linux-swap partition

Solution 1:

Your swap partition is a logical partition, which lives inside the extended partition ( /dev/sda2 in your case ). To expand it, you need unallocated space after it, but inside the extended partition. You have unallocated space after the extended partition, so you have to expand the extended partition to move the unallocated space into the extended partition, then you can expand the swap partition.

In order to resize a partition, it must not be mounted ( the key icon shows it is mounted ). You will need to right click on the swap partition and choose to unmount/swapoff so you can expand it. Since your root partition is also a logical partition though, you will not be able to unmount it, and thus, leave the extended partition unlocked so you can resize it, so you will need to do this from the livecd instead.

Solution 2:

You'll need to reboot into a Live environment (CD, USB, etc) so that the partitions aren't mounted when you try to resize them.

From there it's just a case of loading up Gparted (it seems you're good friends already) and scaling up.