Skip to content

Instantly share code, notes, and snippets.

@RaphaelAudet
Last active August 29, 2015 14:04
Show Gist options
  • Save RaphaelAudet/19df3bd00c6577eb5996 to your computer and use it in GitHub Desktop.
Save RaphaelAudet/19df3bd00c6577eb5996 to your computer and use it in GitHub Desktop.
add swap from scratch
#!/bin/bash
# http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/
dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
mkswap /swapfile1
chmod 0600 /swapfile1
echo '/swapfile1 swap swap defaults 0 0' >> /etc/fstab
#swapon -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment