Skip to content

Instantly share code, notes, and snippets.

@Kr0n0
Created May 17, 2019 02:35
Show Gist options
  • Save Kr0n0/46539425e8a6e89f360d47738f4f1e80 to your computer and use it in GitHub Desktop.
Save Kr0n0/46539425e8a6e89f360d47738f4f1e80 to your computer and use it in GitHub Desktop.
Example for swapfile creation
#!/bin/sh
# Example for swapfile creation
# Run as root/sudo
mkdir -p /data/swap
fallocate -l 8G /data/swap/swapfile.000
chmod 600 /data/swap/swapfile.000
mkswap /data/swap/swapfile.000
swapon /data/swap/swapfile.000
swapon --show
echo "/data/swap/swapfile.000 swap swap defaults,noauto 0 0" >> /etc/fstab
free -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment