To disable swap permanently in Ubuntu, you need to follow these steps:
- Open a terminal and run the command sudo swapoff -a to disable swap temporarily.
- Open the /etc/fstab file in a text editor with administrative privileges by running the command sudo nano /etc/fstab.
- Locate the line that contains the swap partition and comment it out by adding a # character at the beginning of the line. This will prevent the system from trying to mount the swap partition at boot.
- Save the file and exit the text editor.
- Reboot your system to apply the changes.
Note: Disabling swap permanently is not recommended unless you have a good reason to do so, as it can have negative effects on system performance. It is generally better to simply reduce the size of the swap partition instead.