Skip to content

Instantly share code, notes, and snippets.

@florentdestremau
Created March 15, 2018 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florentdestremau/3c5d19f533784a93e0fa893740a5161c to your computer and use it in GitHub Desktop.
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
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