How to disable swap partition under 'Ubuntu MATE'?

I would like to know if the tutorial - linked here - on how to disable the swap partition, is valid also for 'Ubuntu MATE', though it mentions CentOS?

This should help you:

Good information on disabling the swapspace - for the time of a session, I believe - albeit there is very brief information about disabling it permanently or deleting it for good.

Is swapfile not more handy than swap partition?

1 Like

This is from three years ago, but might help you. From what I gather from what I have read deleting swap file or partition and editing fstab is what is needed. Not sure though.

1 Like

I have dealt with swapfile before, but in this case, it is the partition. Nonetheless, it seems we are back to the first tutorial I asked about in the starter post. Seems like after disabling the swap with sudo swapoff -a, I do need to comment out a line in /etc/fstab. Since it is the partition and not a file we are talking about now, my question is, whether the space reserved for the swap, will be returned as free hard drive space or will it remain reserved for the theoretical swap? Checking out on 'GParted', apparently there is no clear separate swap partition, which I could delete; instead, something of "swap" is mentioned as a logical volume of the main drive space.

Hello MSX

You seem to know more than I do about the swap file/partition. My comment here is more as a warning to others who might read this thread.

BE CAREFUL - to the best of my knowledge the swap partition or file is required if you wish to "hibernate" your computer (may be more common when using a notebook (laptop)).

Please correct me if I'm wrong. :slightly_smiling_face:

The same I was informed about in some article that I read: swap is useful for system hibernation purposes. Hibernation is a very specific thing though and most of the cases, I just either use sleep mode or shut the system down, if I am not intending to use it for longer at a time. I have 16 (2*8) GB or RAM that is underused anyway and I see no particular purpose - even with occasional use of 'VirtualBox' at about 6 GB of RAM consumption per running case - in having the swap. Unless the swap gives boost to the performance, which I doubt.

By the way, y'know, I do not have much patience for games majority of times and I do not like when things get complicated this way, in an environment, where someone should at least know the theoretical solution. For some reason, notwithstanding, nobody knows nothing or tells nothing - you do not want to spoil me the solution, guys?

So I imagine that a question might arize, should one have a swap partition or a swap file? Please read the following two pages for some organized thinking on that subject:

There are a lot more pages on this subject out there. Good luck gentlemen.

1 Like