Created
January 22, 2021 04:54
-
-
Save khoa-le/e9587af6827ee66f9e046b9a83c74185 to your computer and use it in GitHub Desktop.
Create 4G 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
#Create 4G swap (128M*32) | |
sudo dd if=/dev/zero of=/swapfile bs=128M count=32 | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
6. Enable the swap file at boot time by editing the /etc/fstab file. | |
Open the file in the editor: | |
$ sudo vi /etc/fstab | |
Add the following new line at the end of the file, save the file, and then exit: | |
/swapfile swap swap defaults 0 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment