Created
December 19, 2016 08:09
-
-
Save v1shwa/1bddf8ceb848adf7053be48f6aac2a1d to your computer and use it in GitHub Desktop.
Quick temporary swap
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 | |
sudo fallocate -l 4G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
# Verification | |
sudo swapon -s |
If there is a problem with fallocate:
sudo dd if=/dev/zero of=/swapfile count=4096 bs=1MiB
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
curl -sSL https://git.io/v1daO | bash