Blog

Latest Technical Notes

Script to add swap file to CentOS

A quick copy/paste to enable a 4GB swap file on Centos 6/7:

sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo “/swapfile swap swap sw 0 0” >> /etc/fstab

DamianScript to add swap file to CentOS
Share this post

Join the conversation