I partitioned my drive as ext4 with flag swap (sda4). but somehow I can mount it normally as if it is a normal partition, I don’t think this is normal.
$free
total used free shared buff/cache available
Mem: 3797 1493 181 439 2122 1602
Swap: 0 0 0
As you can see, you have no swap partition, but instead you have formatted /dev/sda4 as ext4. The swap flag in the partition table does not reflect what’s on the partition ─ it is only a flag.
If the filesystem on /dev/sda4 is not mounted anywhere, then you can reformat it as a swap partition by way of mkswap. Be sure to then also add it to /etc/fstab with the proper UUID.
More information below…
man mkswap
man fstab
The tutorial below also contains a section on /etc/fstab.