[HowTo] Change swap size in Linux (Ubuntu) lc-root | October 2, 2019 | How To, Manuals, System Files | No Comments From Ubuntu 17, the swap partition was replaced by a swap file. The main advantage of the swap file is easy resizing. In the following example, we will change the swap size from 2 GB to 4 GB. Turn off the swap sudo swapoff -a Resize the swap sudo dd if=/dev/zero of=/swapfile bs=1G count=4 if = input file of = output file bs = block size count = multiplier of blocks Make the file as swap sudo mkswap /swapfile Activate the swap file sudo swapon /swapfile Check the amount of swap available grep SwapTotal /proc/meminfo Related Posts [Error] Could not reliably determine the server’s fully qualified domain name … No Comments | Feb 9, 2012 [Test] oDesk Unix Test Questions and Answers 2 Comments | Dec 30, 2012 [How To] Install the new features HUD (Head-Up Display) in Ubuntu 12.04 LTS Precise Pangolin 2 Comments | Jan 27, 2012 Protected: oDesk TCP/IP Test Questions and Answers Discussions 3 Comments | Sep 3, 2012 About The Author lc-root Leave a Reply Cancel reply This site uses Akismet to reduce spam. Learn how your comment data is processed.