This article is intended for systems administrators that are comfortable with Linux. If after reading this article you are scratching your head, please contact Viakoo support and we can assist you with the process.
To determine if a swap file already exists, issue the command:
cat /proc/swaps
------------------------------------------------------------------------------------------------
In the following example, we’ll extend the swap space available in the /swapfile to 2GB.
You can do "df" command, and see if you have enough free space first under / (root) directory.
To change the size of the swap partition (file):
- Turn off all swap processes
|
sudo swapoff -a |
- Resize the swap
|
sudo dd if=/dev/zero of=/swapfile bs=1M count=2000 |
if = input file
of = output file
bs = block size
count = multiplier of blocks
- Make the file usable as swap
|
sudo mkswap /swapfile |
- Activate the swap file
|
sudo swapon /swapfile |
- Check the amount of swap available
|
grep SwapTotal /proc/meminfo |
Comments