Ubuntu Version:
24.04.2 LTS
Desktop Environment (if applicable):
GNOME
Problem Description:
Setting a swap partion in swapon
seems to be non-persistent.
I would like to enable hibernation on my system because all other sleep methods are less reliable on my somewhat compromised machine. They seem all seem to fail to come back up at times. Tried leaving the system, suspending it, pressing the sleep mode key on the keyboard. None is reliable, at least not on this system.
So, I created a swap partition on my NVME and hibernate to there.
This works, until it doesn’t. And I then have to reboot the system.
This morning, I tried looking into the problem.
$ sudo systemctl hibernate
[sudo] password for scohen:
Call to Hibernate failed: Not enough suitable swap space for hibernation available on compatible block devices and file systems
Say what???
I saw this same message a few days earlier. I had then executed this command and it worked:
sudo swapon PARTLABEL=/dev/nvme0n1p4
I was then able to reliably hibernate my system until it stopped working again yesterday.
~$ swapon -T --show
returned no output. My swap partition had gone away!
I opened gparted just now. There I noticed that when I highlighted my swap partition (which still existed) there was “swapon” item on the Partition menu. I clicked it, closed GParted, and then, once again, I was able to hibernate the system. (Sorry, GParted disables print screen for some reason or I’d include a screenshot.)
But how confident should I be that this swap partition will persist? Something caused it to go away before and I don’t know what that was.
I do have one idea. I don’t know if it’s relevant or not. But I’ll share it with you. After successfully hibernating the system, I closed the lid of the laptop. I don’t usually do this. When I opened it back up, the system came on without pressing the power button, in some sort of disabled mode where no keypresses or mouse clicks did anything, forcing reboot. From that point on, hibernation no longer worked. Again, this may or may not be relevant.
But why would a swapon enablement of a swap partition go away?
Relevant System Information:
Lenovo Thinkpad P16 Gen 2
NVidia RTX 3500 Ada Gen GPU.
Screenshots or Error Messages:
What I’ve Tried: