Actions

Extend Swap File

From Jedisaber Wiki

Revision as of 00:31, 5 March 2025 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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