Created
August 2, 2017 00:09
-
-
Save Noogic/d860a64fe51a485d85232bc31aa675c2 to your computer and use it in GitHub Desktop.
Create swap
This file contains hidden or 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 | |
| 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