Creating a swap file

From hakchi
Revision as of 16:25, 30 May 2018 by DanTheMan827 (talk | contribs) (DanTheMan827 moved page Swapfile to Guide:Swapfile without leaving a redirect)
Jump to: navigation, search

To create swapfile (One time only)

fallocate -l 256MB /media/256MB.swap

dd if=/dev/zero of=/media/256MB.swap bs=1M count=256

chmod 600 /media/256MB.swap

mkswap /media/256MB.swap

To enable swap memory

swapon /media/256MB.swap

To disable swap memory

swapoff /media/256MB.swap


Swapfile is disabled each time the console is booted unless you add `swapon` to the preinit...