I enabled systemd-logind debug logging, and I saw:

Jan 06 17:45:18 surprise systemd-logind[73027]: Got message type=method_call 
sender=:1.264 destination=:1.220 path=/org/freedesktop/login1 
interface=org.freedesktop.login1.Manager member=CanHibernate cookie=6 
reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Jan 06 17:45:18 surprise systemd-logind[73027]: Sleep mode "disk" is supported 
by the kernel.
Jan 06 17:45:18 surprise systemd-logind[73027]: /dev/dm-2: is a candidate 
device.
Jan 06 17:45:18 surprise systemd-logind[73027]: /dev/sda2: ignoring device with 
lower priority
Jan 06 17:45:18 surprise systemd-logind[73027]: No swap partitions or files 
matching resume config were found in /proc/swaps.
Jan 06 17:45:18 surprise systemd-logind[73027]: Sent message type=method_return 
sender=n/a destination=:1.264 path=n/a interface=n/a member=n/a cookie=185 
reply_cookie=6 signature=s error-name=n/a error-message=n/a
Jan 06 17:45:18 surprise systemd-logind[73027]: Got message type=method_call 
sender=:1.264 destination=:1.220 path=/org/freedesktop/login1 
interface=org.freedesktop.login1.Manager member=CanHybridSleep cookie=7 
reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Jan 06 17:45:18 surprise systemd-logind[73027]: Sleep mode "disk" is supported 
by the kernel.
Jan 06 17:45:18 surprise systemd-logind[73027]: /dev/dm-2: is a candidate 
device.
Jan 06 17:45:18 surprise systemd-logind[73027]: /dev/sda2: ignoring device with 
lower priority
Jan 06 17:45:18 surprise systemd-logind[73027]: No swap partitions or files 
matching resume config were found in /proc/swaps.

However, after a reboot this morning, hibernation does seem to be
working, and I instead see:

Jan 07 09:29:37 surprise systemd-logind[1798]: Got message type=method_call 
sender=:1.125 destination=org.freedesktop.login1 path=/org/freedesktop/login1 
interface=org.freedesktop.login1.Manager member=Hibernate cookie=3 
reply_cookie=0 signature=b error-name=n/a error-message=n/a
Jan 07 09:29:37 surprise systemd-logind[1798]: Sleep mode "disk" is supported 
by the kernel.
Jan 07 09:29:37 surprise systemd-logind[1798]: /dev/sda2: device matches 
configured resume settings.
Jan 07 09:29:37 surprise systemd-logind[1798]: Hibernation will attempt to use 
swap entry with path: /dev/sda2, device: 8:2, offset: 0, priority: -3
Jan 07 09:29:37 surprise systemd-logind[1798]: Enough swap for hibernation, 
Active(anon)=3080788 kB, size=102401108 kB, used=0 kB, threshold=98%

So it looks like the issue is that my resume device was not being
detected correctly previously, meaning that priority was being used
(which resulted in the wrong device being selected).

So, looking at the systemd code at
https://github.com/systemd/systemd/blob/c5b6b4b6d08cf4c16a871401358faeb5a186c02a/src/shared
/sleep-config.c#L422-L426, perhaps setting /sys/power/resume to the
correct device actually was the workaround/fix?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1910252

Title:
  `systemctl hibernate` incorrectly reports "Not enough swap space for
  hibernation"

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1910252/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to