Created
December 18, 2021 21:22
-
-
Save cyb3rsalih/2063d40f212f20676305aaee6dff2c40 to your computer and use it in GitHub Desktop.
Create swap area on linux
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 | |
| echo "Start to create 4GB Swap Area..." | |
| sudo fallocate -l 4G /swapfile | |
| ls -lh /swapfile >> /dev/null | |
| sudo chmod 600 /swapfile | |
| ls -lh /swapfile >> /dev/null | |
| sudo mkswap /swapfile | |
| sudo swapon /swapfile | |
| sudo echo "/swapfile none swap sw 0 0" >> /etc/fstab | |
| echo "Finished!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment