Created
February 13, 2025 06:32
-
-
Save lamngockhuong/9bf61f661d88fc3d823f29496da9af4c to your computer and use it in GitHub Desktop.
Re-Create swap for Linux
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
SWAP_SIZE=16G && SWAP_FILE=/swapfile && sudo swapoff -a && sudo rm -f $SWAP_FILE && sudo fallocate -l $SWAP_SIZE $SWAP_FILE && sudo chmod 600 $SWAP_FILE && sudo mkswap $SWAP_FILE && sudo swapon $SWAP_FILE && echo "$SWAP_FILE 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