Created
June 18, 2023 12:26
-
-
Save pvilas/dc1bc38285c8c31ce25716359ff171d6 to your computer and use it in GitHub Desktop.
Create swap file on Ubuntu
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
# taken from https://www.linode.com/docs/guides/how-to-increase-swap-space-in-ubuntu/ | |
sudo swapon --show # show if there is any swap area | |
free -h | |
sudo fallocate -l 2G /swapfile # allocate the sw file | |
sudo chmod 600 /swapfile # only sudo can write | |
sudo mkswap /swapfile # designate file as swap | |
sudo swapon /swapfile # activate | |
sudo swapon --show # show if the file is activated | |
free -h # show swap | |
sudo cp /etc/fstab /etc/fstab.bak # backup stab file | |
sudo vi /etc/fstab # edit fstab | |
/swapfile swap swap defaults 0 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment