If partitions are showed with a lock in gparted, then they are mounted. Usually GPartEd is able to unmount them, but sometimes this isn't possible, so you have to manually unmount them with the following commands as root:
- umount /dev/sda1
- umount /dev/sda5
If you aren't logged in as root (root normally has '#' at the end of the command prompt whereas a normal user usually has '$'). You need to add
sudo in front of the commands.
In case of the screenshots however, at least /dev/sda1 is mounted in a way it can't be unmounted as it is necessary for the currently running system to work.
One way you can avoid the drives being mounted ("locked") in the first place, is using a liveCD like PartedMagic (http://www.partedmagic.com). This one really shouldn't mount any of your partitions if you don't manually say so.