Skip to content

Instantly share code, notes, and snippets.

@vshmoylov
Created January 31, 2024 09:08
Show Gist options
  • Save vshmoylov/05ee2c27b9955cd7a30f232e41eaa9b4 to your computer and use it in GitHub Desktop.
Save vshmoylov/05ee2c27b9955cd7a30f232e41eaa9b4 to your computer and use it in GitHub Desktop.
Create and enable swap
#!/bin/bash
# should be run as root
fallocate -l 1G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment