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
# Create the file itself | |
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096 status=progress | |
# Only root should be able to read and write | |
sudo chmod 600 /swapfile | |
# Format the swap file | |
sudo mkswap /swapfile | |
# Enable the swap |