Trace: SWAP Files

SWAP Files

Prev  
 Next

As I have a computer with enough memory I see no need or value in a SWAP partition. In fact as I am using a SSD for the system drive a SWAP is a concern to the reliability of his drive. The following is a list of method to check and disable SWAP function.

  • The command sudo swapoff -a“turns of an existing SWAP partition. (sudo swapon -a turns it back on)
  • To prevent a SWAP partition being mounted at boot comment out the swap partition in /etc/fstab, sudo vim /etc/fstab. (Another open is to instead use the swapoff -a command in a boot cron job. This allows the swapon -a option to be later used.)
  • The command free -hw shows the current memory status.
  • Some links:
    • How do I disable swap? This article also refers to another that explains why turning of SWAP, even with a lot of RAM, may not be best, however this was written at a time SSD were not common and system RAM availability were in general significantly lower.
    • How To Add Swap Space on Ubuntu 16.04. It is interesting that this article also warns against use of SWAP partitions with SSD storage. This article also mentions the swappiness and vfs_cache_pressure setting.

See:


/app/www/public/data/pages/home_server/home_server_setup/other_services/swap.txt · Last modified: 2023-11-19 Sun wk46 10:47
CC Attribution-Share Alike 4.0 International Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International