Skip to content

Instantly share code, notes, and snippets.

@RxDx
Created August 6, 2024 17:10
Show Gist options
  • Save RxDx/79724c55b2e47af8660d4f8a0c9a5daa to your computer and use it in GitHub Desktop.
Save RxDx/79724c55b2e47af8660d4f8a0c9a5daa to your computer and use it in GitHub Desktop.
VPS Set Up SWAP Partition
# Check Existing SWAP
swapon --show
# Set Up SWAP
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
# Make SWAP Persistant Across Reboots
echo "/swapfile none swap sw 0 0" >> /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment