Ubuntu – Should I remove the swap partition on a system upgraded to 17.04

17.04partitioningswap

Ubuntu 17.04 doesn't have a swap partition, and I commented wondering,

If I just upgraded an older system that installed with a swap partition to 17.04, should I delete my old swap partition?

I have three SSD laptops with swap partitions, which had Ubuntu 16.10 on them a few days ago. Now, all are running version 17.04, but none have a /swapfile even after a few reboots.

  1. Should I keep the old swap partition, or delete it?
  2. Is the swap partition preventing /swapfile from being created, or would I end up with no swap at all?

Best Answer

Ubuntu 17.04 changed the default behavior of the installer from creating a swap partition to creating a swap file. (see the release notes).

With this noted, both Ubuntu pre-17.04 and post-17.04 support both a swap partition and a swap file.

As for whether you should switch or not, I'd look at a question specific to that for details. Summed up here for clarity though:

The main advantage of a swap file over a swap partition is that resizing a swap file is many times easier. Resizing a swap partition requires adjusting the partition layout, probably booting from a live disk if you want to do any real adjustment, and a lot of time to move your data around. The swap file is just a few commands, and can be done live.

In short, if you are happy with your current size of swap partition, there is no reason to change. It'll take just as much effort turning a swap partition into a swap file as it would resizing a swap partition, only difference being future resizes will be much easier.

Related Question