Ubuntu – Resize partition using Gparted

formatgpartedlockpartitioning

I want to resize my primary partition using Gparted, but due to the lock I am not able to do so:

I would be grateful if someone tells me how to get rid of the lock so that I can resize this partition.

The reason why it does not work is that the sda1 partition is 'mounted'. It is accessed by some software and kept in RAM memory for various reasons. It's just like in Windows when some file is being blocked from deletion while accessed/opened by some software. You need to 'unmount' that partition in order to edit it in GParted.
Note : When doing it from an Ubuntu Live media, right-click the swap partition - select swapoff.