Skip to content

Instantly share code, notes, and snippets.

@Noogic
Created August 2, 2017 00:09
Show Gist options
  • Select an option

  • Save Noogic/d860a64fe51a485d85232bc31aa675c2 to your computer and use it in GitHub Desktop.

Select an option

Save Noogic/d860a64fe51a485d85232bc31aa675c2 to your computer and use it in GitHub Desktop.
Create swap
#!/bin/bash
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
# make it permanent
cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment