Pulled from this old RedHat documentation. Below is an example of creating a 512MB swap file.
dd if=/dev/zero of=/var/swap bs=4096 count=131072
mkswap /var/swap
Then Add the following to /etc/fstab:
/var/swap swap swap defaults 0 0
On reboot the system will use the file as swap space. To use it immediately issue the command:
swapon /swapfile
I know this works on Centos and Amazon linux, I expect it to work on all flavors of Linux.
No comments:
Post a Comment