Difference between revisions of "Creating a swap file"

From hakchi
Jump to: navigation, search
m (DanTheMan827 moved page Swapfile to Guide:Swapfile without leaving a redirect)
Line 1: Line 1:
 
+
[[Category:Guides]]
 
== To create swapfile (One time only) ==
 
== To create swapfile (One time only) ==
  

Revision as of 16:36, 30 May 2018

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

Note

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