Skip to content

Instantly share code, notes, and snippets.

@t2mahesh
Created September 19, 2019 01:19
Show Gist options
  • Save t2mahesh/d425e56d5976a0062fe6a4297d061bd7 to your computer and use it in GitHub Desktop.
Save t2mahesh/d425e56d5976a0062fe6a4297d061bd7 to your computer and use it in GitHub Desktop.
Create swap manually
#!/bin/bash
echo "Please wait. It can take a while..."
fallocate -l 1G /swapfile
dd if=/dev/zero of=/swapfile bs=1024 count=1048576
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
mount -a
echo
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment