How to resize Swap file
Resize Swap file size
# Resize Swap to 8GB
- Turn swap off
This moves stuff in swap to the main memory and might take several minutes
```sh
sudo swapoff -a
```
- Create an empty swapfile
- Note that "1G" is basically just the unit and count is an integer.
Together, they define the size. In this case 8GB.
```sh
sudo dd if=/dev/zero of=/swapfile bs=1G count=8
sudo mkswap /swapfile # Set up a Linux swap area
sudo swapon /swapfile # Turn the swap on
```
- Check if it worked
```sh
grep Swap /proc/meminfo
```
# GUI method for increasing the size of swap partition
```sh
sudo apt-get update
sudo apt-get install gparted && sudo gparted
```
# Reference
- https://askubuntu.com/questions/178712/how-to-increase-swap-space
No comments