Site Tools


linux:general:swap

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:general:swap [2018/08/22 11:24] – created lunetikklinux:general:swap [2019/02/12 14:45] (current) lunetikk
Line 9: Line 9:
 Create a swapfile with blocksize 1024 and 2GB Create a swapfile with blocksize 1024 and 2GB
 <code>dd if=/dev/zero of=/swap/swapfile bs=1024 count=2M</code> <code>dd if=/dev/zero of=/swap/swapfile bs=1024 count=2M</code>
-<code></code> 
 Format the file and set permissions Format the file and set permissions
 <code> <code>
 mkswap /swap/swapfile mkswap /swap/swapfile
-chown root:root /tmp/swapfile+chown root:root /swap/swapfile
 chmod 600 /swap/swapfile chmod 600 /swap/swapfile
 </code> </code>
 Add the swapfile to swap Add the swapfile to swap
-swapon /tmp/swapfile+<code> 
 +swapon /swap/swapfile 
 +</code>
  
 === Remove a swapfile from swap === === Remove a swapfile from swap ===
  
-Turn off the swapfile (used swap will be moved to other swap or memory, might take a while) +List the swapfiles 
-swapoff /swap/swap+<code> 
 +swapon -s 
 +</code> 
 +Turn off the swapfile (used swap will be moved to other swap or memory, might take a while)\\ 
 +<code> 
 +swapoff /swap/swapfile 
 +</code>
  
 \\ \\
 \\ \\
-~~DISCUSSION~~+~~DISCUSSION:closed~~
linux/general/swap.1534929865.txt.gz · Last modified: 2018/08/22 11:24 by lunetikk