The are the command to enable SWAP when SWAP has been disabled or not setup at all.
# Allocate 1GB
sudo fallocate -l 1G /swapfile
# Secure
sudo chmod 600 /swapfile
# Setup
sudo mkswap /swapfile
# Activate
sudo swapon /swapfile
And to make it permanent after a reboot:
echo ‘/swapfile swap swap defaults 0 0’ | sudo tee -a /etc/fstab
You can now check if SWAP has been enabled.
sudo swapon –show

Views: 11
