Skip to content

Instantly share code, notes, and snippets.

@hiendnguyen
Last active April 22, 2020 20:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiendnguyen/f35d453ba6ee05d5d431a892341e6f14 to your computer and use it in GitHub Desktop.
Save hiendnguyen/f35d453ba6ee05d5d431a892341e6f14 to your computer and use it in GitHub Desktop.
CentOS 7 Virtual RAM
# In this case, I use 2G swapfile or virtual RAM
sudo dd if=/dev/zero of=/swapfile count=1024 bs=1MiB
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo sh -c '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