sudo swapoff -aReformat swapfile to 2Gsudo dd if=/dev/zero of=/swapfile bs=1k count=2048kSet permisions of filesudo chmod 0600 /swapfileLink swap space to filesudo mkswap /swapfileTurn on swapfile functionsudo swapon -aMake it permanentsudo echo "/swapfile swap swap auto 0 0" | tee -a /etc/fstab