Skip to content

Instantly share code, notes, and snippets.

@thikade
Last active October 18, 2017 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thikade/f7eca4557c7a87e3146b7dbada6b8d1c to your computer and use it in GitHub Desktop.
Save thikade/f7eca4557c7a87e3146b7dbada6b8d1c to your computer and use it in GitHub Desktop.
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab
@thikade
Copy link
Author

thikade commented Oct 18, 2017

fallocate does not work on CentOS 7.4, because of root FS type is XFS!

there u need to do it the old way: dd if=/dev/zero of=/swapfile bs=1K count=1M;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment