Created
April 24, 2020 04:10
-
-
Save donilan/0953b6856c7a3c7d49cab66cd72fdd1e to your computer and use it in GitHub Desktop.
Create swap for centos
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
#!/usr/bin/env | |
sudo dd if=/dev/zero of=/swapfile bs=4096 count=1024k && \ | |
sudo chmod 600 /swapfile && \ | |
sudo mkswap /swapfile && \ | |
sudo swapon /swapfile && \ | |
sudo cp /etc/fstab{,.bak} && \ | |
sudo echo "/swapfile swap 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