How do I resize partition and add unallocated space?
Screenshot of GParted:
The problem is that the partition is locked - you can see the little key icon next to the partition name.
The partition is locked because it is mounted. The easiest way around this is to boot from a live USB or CD (a live Ubuntu CD for example). Then you can unmount /dev/sd2 if it happens to be mounted, then you can make the partition size change.