Advertisement
gregorst

Swap script creator

May 19th, 2018
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1.  
  2. #begin optional swap section
  3. echo "Setting up disk swap..."
  4. free -h
  5. sudo fallocate -l 4G /swapfile
  6. ls -lh /swapfile
  7. sudo chmod 600 /swapfile
  8. sudo mkswap /swapfile
  9. sudo swapon /swapfile
  10. echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
  11. sudo bash -c "echo 'vm.swappiness = 10' >> /etc/sysctl.conf"
  12. free -h
  13. echo "SWAP setup complete..."
  14. #end optional swap section
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement