Skip to content

Instantly share code, notes, and snippets.

@panperla
Last active December 28, 2016 11:27
Show Gist options
  • Save panperla/e942b5426dda5adca0c8b22cef1e6290 to your computer and use it in GitHub Desktop.
Save panperla/e942b5426dda5adca0c8b22cef1e6290 to your computer and use it in GitHub Desktop.

Creating swap partition in a file

#!/bin/bash
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment