Last active
October 18, 2017 16:42
-
-
Save thikade/f7eca4557c7a87e3146b7dbada6b8d1c to your computer and use it in GitHub Desktop.
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
fallocate -l 2G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
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
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;