#!/bin/bash # fallocate -l 8G /swap8file chmod 600 /swap8file mkswap /swap8file swapon /swap8file echo "/swap8file swap swap defaults 0 0" | tee -a /etc/fstab mount -a systemctl daemon-reload