Hacker News new | ask | show | jobs
by botanical 1021 days ago
I have hibernate after following this:

https://ubuntuhandbook.org/index.php/2021/08/enable-hibernat...

But I don't have full disk encryption so I don't know how it works with it.

1 comments

I tried that and it didn't work on my work ThinkPad (also those steps are dangerous it could brick your system if you so much as make a single mistake).

But that doesn't answer my question of why something as basic as Hibernate (copy RAM contents to HDD on power-OFF, then reverse on power-ON) isn't something that works out of the box on Linux distros, and instead requires 2h of tutorial reading and dangerous low-lvel tinkering for it to (maybe) work or brick your system if you mess it up.

It worked out of the box on my Arch install. I'm running a LUKS volume which holds an LVM with the ext4 fs for the system and the swap.

I'm also running TPM + PIN / FIDO2 unlocking.

Didn't need to fiddle with anything. The most part of this install was going through the manual process of creating filesystems and whatnot.

Bonus points compared to Windows for actually staying asleep instead of randomly waking up while in my bag.

>It worked out of the box on my Arch install.

Ubuntu isn't Arch I think. Average Joe switching away form Windows isn't gonna start learning Arch.

>Bonus points compared to Windows for actually staying asleep instead of randomly waking up while in my bag.

That doesn't happen under hibernate. You used sleep thinking it was hibernate, that's why you had that issue.

> That doesn't happen under hibernate. You used sleep thinking it was hibernate, that's why you had that issue.

I mean, while asleep, the PC blinks its annoying light every second. While hibernating, it doesn't. I'm pretty sure there were no blinky lights, they would have prevented me from falling asleep. It's why I went out of my way to enable hibernating.

Also, see the other posts around the thread. There are absolutely ways to wake up a PC from hibernation. Even from full shutdown.

The Linux kernel disable hibernation when secure boot is enabled for security reasons (it enables the lockdown mode). I don't think it's especially an Ubuntu/distro problem. When secure boot is disabled, I think hibernation is supposed to work fine.
It works fine with secure boot enabled on my arch install.

But I do use a unified image which the UEFI boots directly (EFISTUB, no grub or anything). I don't know if that makes a difference.

>But I do use a unified image which the UEFI boots directly (EFISTUB, no grub or anything).

Do you have any links on this kind of image? Or did you build it yourself?

Apparently systemd supports building it now somehow (search for UKI, unified kernel image), but I'm too lazy to switch, since my current setup works great. But sooner or later I may be forced to, since my solution is apparently no longer maintained.

I've followed this: https://wiki.archlinux.org/title/Unified_Extensible_Firmware...

Basically, my distro will install the kernel, initrd and cpu microcode normally to /boot. But at the end of it, there's a hook being triggered, that calls sbupdate with stitches together the kernel, command line, initrd, and cpu microcode, signs it and dumps it in the /EFI partition as a single file. /boot is not a separate partition on my system, it lives inside the encrypted /. I also told my UEFI about this specific image using efibootmgr. This allows me to register the image as a bootable OS and use the UEFI's boot manager to choose between Linux and Windows on startup.

If you browse around that Arch Wiki page, they also tell you how to sign your own boot images. I've installed my own keys in the UEFI, since Arch's kernel isn't signed by anybody.