Skip to content

Instantly share code, notes, and snippets.

@grzegorzblaszczyk
Last active August 5, 2024 11:07
Show Gist options
  • Save grzegorzblaszczyk/9384559 to your computer and use it in GitHub Desktop.
Save grzegorzblaszczyk/9384559 to your computer and use it in GitHub Desktop.
Quick gist that recreates a swap file with 2048M swap
#!/bin/bash
SWAP_FILE="/swap"
sudo swapoff ${SWAP_FILE}
sudo dd if=/dev/zero of=${SWAP_FILE} bs=1M count=2048 && sudo mkswap ${SWAP_FILE} && sudo chmod 0600 ${SWAP_FILE} && sudo swapon ${SWAP_FILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment