Richard G
Verified User
Ah oke.. yes.. well...
Try this, but use at your own risk!!!!
It depends on the amount of disk space you have, so you can lower it, I will write how.
You have to do this as root. Explanation is for RHEL and deratives. With Debian and deratives you might need to use the sudo command in front of the commands.
# Check disk space
# Check if there is already swap active
# Create 4 GB swap file
if you have little disk space and only want a 2 gb swap space, change the
# Set the correct permission
# Setup and activate swapfile
# Make changes permanent
or edit the /etc/fstab file and add this line:
# Doublecheck if it's working now
Reboot vps/server and check again with the
Good luck.
Try this, but use at your own risk!!!!
It depends on the amount of disk space you have, so you can lower it, I will write how.
You have to do this as root. Explanation is for RHEL and deratives. With Debian and deratives you might need to use the sudo command in front of the commands.
# Check disk space
df -h
# Check if there is already swap active
swapon --show
# Create 4 GB swap file
cd /
sudo dd if=/dev/zero of=/swapfile bs=1G count=4
if you have little disk space and only want a 2 gb swap space, change the
count=4
to count=2
# Set the correct permission
chmod 600 /swapfile
# Setup and activate swapfile
mkswap /swapfile
swapon /swapfile
# Make changes permanent
echo /swapfile swap swap defaults 0 0 >> /etc/fstab
or edit the /etc/fstab file and add this line:
/swapfile swap swap defaults 0 0
# Doublecheck if it's working now
swapon --show
free
Reboot vps/server and check again with the
free
or swapon --show
command.Good luck.