Swap is a space on a disk that is used when the amount of physical RAM memory is full. When a Linux system runs out of RAM, inactive pages are moved from the RAM to the swap space.
Swap space can take the form of either a dedicated swap partition or a swap file. In most cases, when running Linux on a virtual machine, a swap partition is not present, but in another situation, swap exist on machines.
Some software like Kubernetes requires that swap should be turned off. This article will show to you how to disable swap.
How to disable swap
The easiest way to disable swap is to:
swapoff -a: this will immediately disable swap
- remove any swap entry from
rebootthe system. If the swap is gone, good. If for some reason, it is still here, you had to remove the swap partition. Repeat steps 1 and 2 and, after that, use
partedto remove the (now unused) swap partition.
For CentOS it requires to regenerate initramfs with dracut command:
dracut --regenerate-all --force
You can read more linux guides by link https://linuxnotes.org/category/linux-how-to/
Viva La Linux!