Skip to content

Instantly share code, notes, and snippets.

@deckerego
Last active October 13, 2016 18:34
Show Gist options
  • Save deckerego/7828482 to your computer and use it in GitHub Desktop.
Save deckerego/7828482 to your computer and use it in GitHub Desktop.
Create swap file in Linux (as opposed to a swap partition)
dd if=/dev/zero of=/swapfile bs=1024 count=1048576
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment