Gparted only showed grow the swap to the right and moving the beginning to be possible, even when deactivating the swap (swapoff
).
What allowed the move was to also close the currently active LUKS volume which the swap was placed on (right click on the swap in gparted and close encryption).
This moving without size change should be safe for the LUKS volume in it because moving an encrypted value is invisible to LUKS. Even expanding should be okay (though you then have to expand the LUKS volume inside it, or let gparted do it) and for shrinking you or the program (like gparted) first needs to shrink what's inside and then shrink the partition.
If you want the swap to work again afterwards without rebooting, you have to decrypt the partition again to the same name (the name in /dev/mapper/<name_here>
) it used before and then activate the swap on the decrypted luks volume again.