6

According to 18.04 Bionic Beaver release notes:

For new installs, a swap file will be used by default instead of a swap partition.
Changes since 16.04

What will happen to the existing swap partition after the scheduled upgrade in July from my current Ubuntu 16.04 to Ubuntu 18.04? Will it still exist? If so, will it be used, or just take up dormant space?

karel
  • 114,770
jordy
  • 1,670
  • For distribution upgrades, the existing swap partition will be reused instead of creating a new swap file. In your case the existing swap partition from 16.04 will remain unchanged and be reused in 18.04. – karel Jun 18 '18 at 00:30
  • 1
    Is there a reference to cite for this? – jordy Jun 18 '18 at 00:42
  • 3
    This change was first introduce in 17.04, and 17.04's Release Notes are more explicit: "For new installs, a swap file will be used instead of a swap partition." (emphasis mine) – muru Jun 18 '18 at 01:48
  • 2
    Even the quoted release notes in the original question are not necessarily true. For example, when installing Ubuntu 18.04 with full disk encryption, it will use a swap partition (LVM) rather than a swap file. – Steve Jun 18 '18 at 06:43
  • From a first hand experience when I ran an upgrade from 16.04 to 18.04 it kept the swap partition I already had without any problems. Honestly, if you are that concerned about having a swap partition or a file after upgrading, then try it first in VirtualBox or some sort of VM where you install 16.04 first with a swap partition then run an upgrade to make sure that it is not going to change it on you. – Terrance Jun 18 '18 at 13:51
  • 1
    Also, I performed a quick installation of Xubuntu 18.04 in a VM for testing purposes that told it to use all the space automatically, and it setup a swap partition. So, I think the link above may only cover a specific desktop version. Or it might have been changed for 18.04 not having Unity. I am not 100% sure though. – Terrance Jun 18 '18 at 13:58

1 Answers1

7

For distribution upgrades, the existing swap partition will be reused instead of creating a new swap file. In your case the existing swap partition from 16.04 will remain unchanged and be reused in 18.04.

You can share swap area with two or more operating systems. To share swap space, create the swap space when you install the first operating system and then when you install the second one, do not create a new swap space, instead just use the first OS's swap space as the mount point for swap space of the second OS.source

For an explanation about the differences between a swap file and a swap partition see this answer.

karel
  • 114,770
  • 1
    I upgraded and simplified the question. But I would still like a source that explicitly states what will happen. – jordy Jun 18 '18 at 01:31
  • 3
    @danthonyd I think you won't get the definitive citation you are looking for. The developers seem clear enough in the 17.04 release notes, and all of us who upgraded then had the same (expected) experience. – user535733 Jun 18 '18 at 03:47