Create new partition with gparted

I have a single partition with a swapfile, i want to make a separate 4gb swap partition. Gparted does not allow me to do anything, says partition is mounted, does not allow me to unmount.
what should I do?

Boot from a livecd USB, and run gparted from there. If you have to shrink your / partition, do that, then make your swap partition. Tell gparted that the filesystem is 'swap'. You may have to put a line in your fstab to make it work. I don't use swap these days, as I have an abundance of RAM.

I have a swap partition because I dual boot with Parrot OS and Parrot adds one by default. You have to put swap on, and edit the fstab file.

This tutorial is not exactly what he wants, but will help to edit fstab:
http://ubuntuhandbook.org/index.php/2019/05/fix-slow-boot-ubuntu-18-04/
Having a mismatched UUID will slow your boot process.

Good luck, and remember to backup before shrinking/moving any partition.

it worked nicely. I use swap in order to be able to hibernate. It allows me to work on my laptop, commute, leave it for two days without power and come back exactly in the same workspace.