I'm trying to enable hibernation on Ubuntu 22.04 (following this tutorial) but I'm confused about what my system tells me about the current swap configuration so I'm hesitant to just change it without knowing what I do.
Before we start, some data about my system:
- ThinkPad T14 Gen 1 AMD
- Ubuntu 22.04.2 LTS
- Kernel 5.19.0-41-generic
- 48 GB of RAM
- 1 TB of storage
- full disk encryption (I enabled it in the Ubuntu installer)
My current swap settings are as they were configured on install. I haven't changed anything (hardware or swap config) since then.
System Monitor tells me that I have 976 MiB of Swap (which is ~96 % used all the time). This already is confusing as the swap FAQ on help.ubuntu.com says that the swap size should be "at least sqrt(ram size)", which sould be almost 7 GB in my case. My whole system actually feels laggy sometimes, which might be due to the small swap? But the RAM is also > 80 % full most of the time, which might add to that problem.
Anyways...
swapon
tells me that the swap is a partition.
$ sudo swapon
NAME TYPE SIZE USED PRIO
/dev/dm-2 partition 976M 945M -2
$ ls /dev | grep dm-2
brw-rw---- 1 root disk 253, 2 Mai 4 16:05 dm-2
Looking into GParted, I can't find this disk or partition

There's only /dev/nvme0n1
with 3 partitions p1...p3
. Why does the swap partition not show up?
Reading about swap file vs. swap partition, I've seen a lot of opinions but I'm leaning towards a swap file, because it is more flexible to handle (and some people say that it is better with full disk encryption and SSD's, but nobody gives hard evidence for their opinion, so idk)
Now my questions are:
- does the current setup (as it was created by the Ubuntu installer) make any sense? Because for me it feels a bit odd :-P
- how can I move from this setup to a swapfile (that eventually supports hibernation) without destroying my system? And how can I fully remove the existing swap partition in the process?
Any hints, links, etc. appreciated!
Thanks in advance!