Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #First, create a file which will be used as swap space
  2. #With non Centos
  3. sudo fallocate -l 1G /swapfile
  4. # With Centos
  5. sudo dd if=/dev/zero of=/swapfile bs=2048 count=1048576
  6.  
  7. #Ensure that only the root user can read and write the swap file:
  8. sudo chmod 600 /swapfile
  9.  
  10. #set up a Linux swap area on the file
  11. sudo mkswap /swapfile
  12.  
  13. #activate the swap
  14. sudo swapon /swapfile
  15.  
  16. #Make the change permanent by opening the /etc/fstab file
  17. sudo nano /etc/fstab
  18.  
  19. #and pasting the following line:
  20. /swapfile swap swap defaults 0 0
  21.  
  22. #Verify
  23. sudo swapon --show
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement