News for hackers. Stuff that matters.
Re:Ask HN: Why is the Linux community struggling to implemen... by shortformblog on Thursday April 08, 2021 @11:07AM (#26739726)
I got hibernation working on my PopOS machine a while ago, but it took a lot of steps. The problem is that it requires a LOT of swap space. That machine has 32GB of RAM—and that means I have to have a dedicated swap partition at least that large to make it work.

Honestly, it would probably be easier to just run everything off a VM if having persistent states matters to you.

Re:Ask HN: Why is the Linux community struggling to implemen... by _joel on Thursday April 08, 2021 @11:08AM (#26739738)
Does it need a dedicated partition or can it be created with a loopback file on disk?
Re:Ask HN: Why is the Linux community struggling to implemen... by l3s2d on Thursday April 08, 2021 @11:53AM (#26740304)
A swapfile can be used in place of a swap partition.

https://wiki.archlinux.org/index.php/Swap#Swap_file

Re:Ask HN: Why is the Linux community struggling to implemen... by AshamedCaptain on Thursday April 08, 2021 @05:46PM (#26744201)
At the cost of being practically forced to write your own initramfs, since few of the distro ones actually support this. Surprisingly how few projects use uswsusp anymore...
Re:Ask HN: Why is the Linux community struggling to implemen... by rhn_mk1 on Thursday April 08, 2021 @11:12AM (#26739801)
Wake up from hibernation kicks in early in the boot process, before file systems are resumed. You must have a partition for that.
Re:Ask HN: Why is the Linux community struggling to implemen... by _joel on Thursday April 08, 2021 @11:14AM (#26739832)
Re:Ask HN: Why is the Linux community struggling to implemen... by exikyut on Thursday April 08, 2021 @12:14PM (#26740570)
The default kernel resume implementation will look for a hibernate header in the visible swap partitions on boot.

If you boot into an initramfs and make additional swap partitions visible, eg via losetup, you can then write the device major:minor into /sys/power/resume and kaboom the kernel will freeze userspace, read the hibernation image out of there, then jump to it.