User Tools

Site Tools


linux:increase_swap-file_size

This is an old revision of the document!


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.1651083415.txt.gz · Last modified: 2023/05/29 11:53 (external edit)