Addendum 15 June 2023: cavypmos video guide: https://www.youtube.com/watch?v=Bf3j0QlrSs8
How to create a swap file, open a terminal and enter (best to copy and paste) the following commands individually.
Do not use this method if you already have a functional machine set up with a swap partition. I do not include a swap partition with my install, favouring a swap file post install during the configuration of my computer.
Be warned if you intend to use the hibernate function, you must have a swap partition to mirror your ram. For example if your machine has 16GB it will require a 16GB swap partition.
sudo swapon --show
There should be no printout, if there is. Stop! Do not proceed any further, you will destroy your system
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo nano /etc/fstab
Add the following text to the /etc/fstab
file under the last entry, should be /
or the /home
depending on your schema.
/swapfile swap swap defaults 0 0
These next steps are ran in terminal
sudo swapon --show
NAME TYPE SIZE USED PRIO
/swapfile file 4G 0B -2
sudo update-grub
Now the important bit reboot your machine
systemctl reboot
To check if the swap functions correctly
sudo swapon --show
Don't forget to adjust your swappiness to the value of 10 at: https://sourceforge.net/p/peppermintos/pepwiki/Configure%20PeppermintOS/
Much simpler is another way. I just installed the package dphys-swapfile
and it autoaticly generated a swapfile with 2GB and activated it.
This is, when you have not much physical RAM. The swap space is much slower than pysical RAM.
I use a SSD Disk, so no problem.
to show it:
sudo swapon --show
NAME TYPE SIZE USED PRIO
/var/swap file 2G 768K -2