Skip to content

Instantly share code, notes, and snippets.

@NamPNQ
Last active August 29, 2016 16:52
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 NamPNQ/6ade72f62cdbb213730483260acdc0d5 to your computer and use it in GitHub Desktop.
Save NamPNQ/6ade72f62cdbb213730483260acdc0d5 to your computer and use it in GitHub Desktop.
# Sudo
sudo su
# Check
swapon -s
# Create swap file
fallocate -l 10G /swapfile && chmod 600 /swapfile # or dd if=/dev/zero of=/swapfile bs=1M count=2048
# Make swapfile a Linux-managed swap area
mkswap /swapfile
# Activate swap temporary
swapon /swapfile
# Automatic, insert /etc/fstab
/swapfile none swap sw 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment