Created
August 1, 2024 15:41
-
-
Save Natgho/50f4784cdefbb82c2c58eb96dde3a4c1 to your computer and use it in GitHub Desktop.
swap_creator_for_ubuntu.sh
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
sudo fallocate -l 16G /swapfile | |
sudo dd if=/dev/zero of=/swapfile bs=1M count=16384 | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab | |
# check | |
# sudo swapon --show | |
# free -h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment