I have Archlinux x86_64 installation on my laptop and desktop. At the time of installation, I have created a swap partition with fdisk and enabled that with
sudo swapon /dev/sda3.
But even with
sysctl vm.swappiness set to
0, my system still writes to the swap partition when my system memory is half used, and at the time I copy/move a large file to somewhere, which makes the system very slow. In such case, I used to turn off the swap with
sudo swapoff /dev/sda3.
Nowadays, I generally turn off the swap after boot, and enable it when I truly need the swap (and I have a ruby script to monitor RAM usage, and turn on swap when it's needed). Swap is activated again in the next boot. I have no entries in the
/etc/fstab regarding swap.
Is there a way to permanently disable the swap device without deleting the device?