Created
March 15, 2018 10:45
-
-
Save florentdestremau/3c5d19f533784a93e0fa893740a5161c to your computer and use it in GitHub Desktop.
Create annd activate a 1G swap file on a Digital Ocean ubuntu 16.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo swapon --show | |
free -h | |
sudo fallocate -l 1G /swapfile | |
ls -lh /swapfile | |
sudo chmod 600 /swapfile | |
ls -lh /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo swapon --show | |
free -h | |
sudo cp /etc/fstab /etc/fstab.bak | |
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
source : https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04