How to Setup a SwapFile in Ubuntu Linux

Follow the following steps

sudo dd if=/dev/zero of=/swapfile count=2048 bs=1M
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile   none    swap    sw    0   0' | sudo tee -a /etc/fstab
free -m

That’s all you need to do and you will have a swap file ready on your system. Change the count value to your suiting. 2048 means 2GB swap file. If you need more, change accordingly.

Donate to Support my work (मेरे काम का समर्थन करने के लिए दान करें)

bc1qxk7n6sme5pu7xtq4wc4m5ax25fhc9tr7lzz5mk

ltc1qd4lns8wzp0snx2tr9k0evqx4um3yr5t36pwynp

One Response

Leave a Reply

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