Skip to content

Instantly share code, notes, and snippets.

@emj365
Forked from aliuygur/add-swap-file.sh
Created October 14, 2017 20:16
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 emj365/aeb70cde01da7f03617fb3d891234ba8 to your computer and use it in GitHub Desktop.
Save emj365/aeb70cde01da7f03617fb3d891234ba8 to your computer and use it in GitHub Desktop.
this file add 4GB swap file to ubuntu 14.04 x64
#!/bin/bash
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab
echo "Added!"
free -m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment