Ubuntu 20+ Add swap space

Create a swap file

sudo fallocate -l 2G /swapfile

sudo chmod 600 /swapfile

sudo mkswap /swapfile

Output

Setting up swapspace version 1, size = 2 GiB (2147479552 bytes)

no label, UUID=fde7d2c8–06ea-400a-9027-fd731d8ab4c8

sudo swapon /swapfile

vim nano /etc/fstab

Add this line

/swapfile swap swap defaults 0 0

sudo swapon — show

Output

NAME TYPE SIZE USED PRIO

/swapfile file 2G 0B -1

sudo free -h

Output

total used free shared buff/cache available

Mem: 981Mi 97Mi 68Mi 0.0Ki 814Mi 735Mi

Swap: 2.0Gi 10Mi 1.9Gi

More details https://linuxize.com/post/how-to-add-swap-space-on-ubuntu-20-04/

Originally published at https://erpgulf.com on August 22, 2021.

--

--

ERPGulf - - - Whatsapp: 00974-55124924
ERPGulf - - - Whatsapp: 00974-55124924

Written by ERPGulf - - - Whatsapp: 00974-55124924

Customized hosting of ERPNext for the Gulf countries. . Contact us on sales@ERPGulf.com Call 00974–55124924. Build your cloud server on www.Claudion.com

No responses yet