Advertisement
TangentFox

Make swap file

May 15th, 2019 (edited)
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.33 KB | None | 0 0
  1. # All commands must be run as root except the final section.
  2.  
  3. fallocate -l 1G /swapfile   # 1 GB file
  4. chmod 600 /swapfile         # root only read-write
  5. mkswap /swapfile
  6. #swapon /swapfile
  7. echo "/swapfile none swap sw 0 0" >> /etc/fstab   # make sure it functions after reboot
  8.  
  9. mount -a
  10. free -m   # make sure it is working now
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement