...
Code Block | ||
---|---|---|
| ||
sudo su |
Create a swap file with 4 blocks of 1GB:
Code Block | ||
---|---|---|
| ||
dd if=/dev/zero of=/mnt/swap bs=1G count=4 |
Enable the file for swap usage:
Code Block | ||
---|---|---|
| ||
chmod 600 /mnt/swap mkswap /mnt/swap swapon /mnt/swap |
Persist the swap file:
- add to /etc/fstab (bottom):
...
Code Block | ||
---|---|---|
| ||
vm.swappiness=30 |
> Detailed procedure here