Created
May 17, 2019 02:35
-
-
Save Kr0n0/46539425e8a6e89f360d47738f4f1e80 to your computer and use it in GitHub Desktop.
Example for swapfile creation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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