Resize swap in Ubuntu 18.04 and later (Linux)
PROBLEM: My swap is too small 🙁 SOLUTION: Disable, resize and enable swap again! 1. Disable swap
1 |
sudo swapoff -a |
2. Resize swap With goal of 2 GB (1 GB * 2)
1 |
sudo dd if=/dev/zero of=/swapfile bs=1G count=2 |
Where: if – input file of – output file bs – block size count – block multiplier Note: If you get error: dd: memory exhausted by input buffer of size 1073741824 bytes (1.0 GiB) just try to change the bs to MB and increase the count size
1 |
sudo dd if=/dev/zero of=/swapfile bs=1M count=2000 |
3. Make…