Created
March 29, 2020 23:03
-
-
Save tennisonchan/55fc5dfd705ec2f0e82d08834cab6de1 to your computer and use it in GitHub Desktop.
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/bash | |
# show an interactive process viewer for Unix | |
htop | |
# to allocate 1G file space to /swapfile | |
sudo fallocate -l 1G /swapfile | |
# write input from /dev/zero to /swapfile for block size of 1024 | |
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576 | |
# set access permission of /swapfiel | |
sudo chmod 600 /swapfile | |
# setting up swapspace | |
sudo mkswap /swapfile | |
# turn on the /swapfile | |
sudo swapon /swapfile | |
# add the following line in /etc/fstab | |
# /swapfile swap swap defaults 0 0 | |
sudo vim /etc/fstab | |
# mount the space | |
sudo mount -a | |
# check the swap | |
htop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment