Created
December 10, 2017 22:05
-
-
Save hugojosefson/e342a6c68c24027a6a594615793eae5a to your computer and use it in GitHub Desktop.
Creates swap on debian, for example on a digitalocean vpc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
touch /var/swap.img | |
chmod 600 /var/swap.img | |
dd if=/dev/zero of=/var/swap.img bs=1M count=4096 | |
mkswap /var/swap.img | |
swapon /var/swap.img | |
echo "" >> /etc/fstab | |
echo "/var/swap.img 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