Differences

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

Link to this comparison view

Both sides previous revision Previous revision
linux:linux-tutorials:swap [2023/07/30 12:12] – ↷ Page moved from linux:linux_tutorials:swap to linux:linux-tutorials:swap Zyzonixlinux:linux-tutorials:swap [2025/01/21 18:25] (current) – [Disable SWAP permanently] Zyzonix
Line 10: Line 10:
  
 //Sourced from [[https://linuxize.com/post/how-to-change-the-swappiness-value-in-linux/|linuxize.com]]// //Sourced from [[https://linuxize.com/post/how-to-change-the-swappiness-value-in-linux/|linuxize.com]]//
 +
 +==== Add SWAP ====
 +**Create SWAP file:**
 +<code bash>sudo fallocate -l 4G /swapfile</code>
 +→ Change 4G to the size of the swap space.
 + 
 +**Change permissions and format file:**
 +<code bash>sudo chmod 600 /swapfile</code>
 +<code bash>sudo mkswap /swapfile</code>
 +
 +**Enable SWAP and verify:**
 +<code bash>sudo swapon /swapfile</code>
 +<code bash>sudo swapon --show</code>
 +
 +**Make swap permanent by adding the following line to ''/etc/fstab'':**
 +<code bash>/swapfile none swap sw 0 0</code>
 +
 +To change the swappiness look at the upper paragraph.
 +
 +//Sourced from [[https://tecadmin.net/how-to-add-swap-in-ubuntu-24-04/|tecadmin.net]]//
  
 ==== Disable SWAP permanently ==== ==== Disable SWAP permanently ====
  • linux/linux-tutorials/swap.txt
  • Last modified: 2025/01/21 18:25
  • by Zyzonix