Created
September 19, 2019 01:19
-
-
Save t2mahesh/d425e56d5976a0062fe6a4297d061bd7 to your computer and use it in GitHub Desktop.
Create swap manually
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 | |
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