Add Swap Memory On Debian (Any version, one liner!)

# SWAP DEBIAN
# change 2G to how many GB of swap you want
dd if=/dev/zero of=/swapfile bs=2G count=2
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab

Leave a Reply

Your email address will not be published. Required fields are marked *