Skip to content

Instantly share code, notes, and snippets.

@webkonstantin
Last active December 16, 2015 10:41
Show Gist options
  • Save webkonstantin/d5cd2f4ef103e831f1fd to your computer and use it in GitHub Desktop.
Save webkonstantin/d5cd2f4ef103e831f1fd to your computer and use it in GitHub Desktop.
add swap file
#!/bin/sh
fallocate -l 2G /swapfile
chmod 600 /swapfile
ls -lh /swapfile
mkswap /swapfile
swapon /swapfile
free -m
echo "/swapfile none swap sw 0 0" >> /etc/fstab
cat /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment