Skip to content

Instantly share code, notes, and snippets.

@macbre
Created November 20, 2017 21:03
Show Gist options
  • Save macbre/7df9d82d300202e14a7f74d1655ce970 to your computer and use it in GitHub Desktop.
Save macbre/7df9d82d300202e14a7f74d1655ce970 to your computer and use it in GitHub Desktop.
Swap file
$ sudo -i
cd /var
touch swap.img
chmod 600 swap.img
dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
mkswap /var/swap.img
swapon /var/swap.img
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