User Tools

Site Tools


linux:increase_swap-file_size

Increase swap file size

Check existing swap file:

sudo swapon -s

Example setting/resetting swapfile to 6GB. Note that while multiple swap files can exist, when hibernating to disk only one swap file is being used.

sudo swapoff /swapfile 
sudo dd if=/dev/zero of=/swapfile count=1k bs=6M
sudo mkswap /swapfile
sudo chown root:root /swapfile 
sudo chmod 600 /swapfile 
sudo swapon /swapfile 
linux/increase_swap-file_size.txt · Last modified: 2023/05/29 11:55 by 127.0.0.1