Files
linuxtips/linux/Swap4g.sh
T
2025-01-02 21:03:29 +01:00

12 lines
202 B
Bash
Executable File

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