Category: ASP
How to increase SWAP on Linux
* __Add a new swap partition__
- show swap usage
swapon -s
- turn off swap
swapoff -a
- create a new swap partition
mkswap /dev/sda1
- turn swap on
swapon -a
* __Add extra swap using files__
- create a file (2gb in this case)
dd if=/dev/zero of=/swap_file3 bs=1048576 count=2048
- make swap
mkswap /swap_file3
- add to swap
swapon /swap_file3
- edit fstab if swap file needs to be used after restart
/swap_file3 none swap sw 0 0