Disable Swap on Raspberry Pi OS Trixie
The old method of disabling swap no longer works
This will still work on previous versions
sudo dphys-swapfile swapoff
sudo dphys-swapfile uninstall
sudo update-rc.d dphys-swapfile remove
sudo apt purge dphys-swapfile --yes
sudo apt autoremove --yes
As the new version uses zram
First turn the swap off
sudo swapoff -a
Then
sudo systemctl mask swap.target
When you reboot the swap wont be running on startup. I belive this leaves the swap partition on your storage however.
Viewing in htop we can see Swp has 0/0K size