Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #First, create a file which will be used as swap space
- #With non Centos
- sudo fallocate -l 1G /swapfile
- # With Centos
- sudo dd if=/dev/zero of=/swapfile bs=2048 count=1048576
- #Ensure that only the root user can read and write the swap file:
- sudo chmod 600 /swapfile
- #set up a Linux swap area on the file
- sudo mkswap /swapfile
- #activate the swap
- sudo swapon /swapfile
- #Make the change permanent by opening the /etc/fstab file
- sudo nano /etc/fstab
- #and pasting the following line:
- /swapfile swap swap defaults 0 0
- #Verify
- sudo swapon --show
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement