Extend Swap File

From Psygen Wiki
Jump to navigation Jump to search

How to Increase Swap Space in Linux

Create a file for swap space

fallocate -l 4G /swapfile_extend_4GB

Set permissions

chmod 600 /swapfile_extend_4GB

Format it for swap

mkswap /swapfile_extend_4GB

Enable swap on it

swapon /swapfile_extend_4GB

Add the following to /etc/fstab:
(So it will persist upon reboot.)

/swapfile_extend_4GB none swap sw 0 0