Last active
August 17, 2019 21:50
-
-
Save robertopc/0cf094a6ca60773a60da10b6aceeba1f to your computer and use it in GitHub Desktop.
Make a swap of 1GB in Linux
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
#!/bin/sh | |
sudo su | |
dd if=/dev/zero of=/swapfile bs=1024 count=1024k | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
# add line in fstab to auto mount swap in startup | |
echo "/swapfile none swap sw 0 0" >> /etc/fstab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment