This may be necessary if you have a VM or if for some reason you just want to be more efficient with your space and have the flexibility of changing your swap space at will.
What we mean is the ability to use a "swap file" or similar to the Windows "pagefile" that normally resides on the root or c: partition of Windows.
Here's all you have to do and then you to can have a single partiton with everything, including the swap file on the root partition if you desire.
fallocate -l 1G /rttswapfile
chmod 600 /rttswapfile
mkswap /rttswapfile
Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes)
no label, UUID=2a8fea79-1fd7-4241-b57f-867be99abb1e
swapon /rttswapfile
#add this to /etc/fstab
/rttswapfile swap swap defaults 0 0
mount -a
#there should be no output, if you get an error there is an issue with your fstab entry for the swapfile.
enable, linux, swapfile, partition, ubuntu, mint, debian, centos, vm, efficient, flexibility, swap, quot, pagefile, resides, partiton, allocate, eg, etc, fallocate, rttswapfile, permissions, user, chmod, swapfle, swapspace, mkswap, mib, bytes, label, uuid, fea, fd, abb, swapon, adding, fstab, defaults, errors, mount, output, entry,