Disabling SWAP in Proxmox

This is required to reduce file system usage of Proxmox, e.g., when recieving io-errors

In some cases, you may need to disable the SWAP space in your Proxmox virtual environment. SWAP is a space on your hard drive that is used to store data temporarily when your system runs out of physical memory (RAM). Disabling SWAP can be useful for improving system performance or for troubleshooting issues.

Prerequisites

Before you begin, make sure you have access to the command line on your Proxmox server. You will need to enter the commands below via the command line.

Instructions

To disable SWAP in Proxmox, follow these steps:

  1. First, use the following command to turn off the SWAP space:

    swapoff /dev/pve/swap
    
  2. Next, deactivate the SWAP logical volume with the following command:

    lvchange -a n /dev/pve/swap
    
  3. Finally, remove the SWAP logical volume with this command:

    lvremove /dev/pve/swap
    

Additional Resources

For more information about SWAP and how to manage it on Proxmox, see the Proxmox documentation.

Last modified February 17, 2023: update (#208) (ea731fc)