Skip to content

Instantly share code, notes, and snippets.

@erming
Last active October 16, 2021 13:53
Show Gist options
  • Save erming/38d35c03917d00375dc65cfc967de589 to your computer and use it in GitHub Desktop.
Save erming/38d35c03917d00375dc65cfc967de589 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Begin..."
sudo dd if=/dev/zero of=/swapfile bs=128M count=16
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
# Verify that the swap space is now active
free -m
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment