Changing the SWAP file size in Ubuntu 18.045
If you install linux without a dedicated swap partition you will get a swap file. The swap file is in root:/swapfile
To see the size you can runswapon --show
You can turn off swap withsudo swapoff /swapfile
If you run `free -h`
you will see that you have 0 swap
Now you can allocate more space to that swapfilesudo fallocate -l 20G /swapfile
Now make that file a swap againsudo mkswap /swapfile
And now turn on swap againsudo swapon /swapfile
Comments