1. Create a file: fallocate -l 2G /swapfile

  2. Secure it: chmod 600 /swapfile

  3. Format: mkswap /swapfile

  4. Enable: swapon /swapfile

  5. Make permanent: Add /swapfile none swap sw 0 0 to /etc/fstab

  6. Verify: swapon --show

Was this answer helpful? 0 Users Found This Useful (0 Votes)