Skip to content

Instantly share code, notes, and snippets.

@toanant
Created August 5, 2016 06:14
Show Gist options
  • Save toanant/3d2c8e016d2790fce214f3a2679ec241 to your computer and use it in GitHub Desktop.
Save toanant/3d2c8e016d2790fce214f3a2679ec241 to your computer and use it in GitHub Desktop.
sudo dd if=/dev/zero of=/swapfile1 bs=1024 count=8388608
sudo chown root:root /swapfile1
sudo chmod 0600 /swapfile1
sudo mkswap /swapfile1
sudo swapon /swapfile1
free -m
sudo swapon -s
sudo -s
echo '/swapfile1 none swap sw 0 0' >> /etc/fstab
echo 'vm.swappiness=30' >> /etc/sysctl.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment