Skip to content

Instantly share code, notes, and snippets.

@eresende
Last active August 29, 2015 14:08
Show Gist options
  • Save eresende/d0ecf5914c56ee0fda17 to your computer and use it in GitHub Desktop.
Save eresende/d0ecf5914c56ee0fda17 to your computer and use it in GitHub Desktop.
Add swap file
#! /bin/bash -ex
/bin/dd if=/dev/zero of=/var/swapfile.1 bs=1M count=4096
/sbin/mkswap /var/swapfile.1
chmod 600 /var/swapfile.1
/sbin/swapon /var/swapfile.1
echo "/var/swapfile.1 swap swap defaults 0 0" >> /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment