Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

I believe so, I remember an article on hibernation+luks being more difficult to set up


sort by: page size:

Hibernate with LUKS (albeit after a lot of hacking) works pretty well on Debian Buster. I've resumed and hibernated for many cycles with no issues. Wifi comes back etc. It never used to be the case, in my experience at least

Hibernation is a very nice feature (I use it for laptop and desktop machines) and it requires a swap partition. Also, a encrypted swap is even more important in this scenario.

In the laptop I'm typing this, swap is one of the partions over a LVM2 physical volume over LUKS.


Does hibernation work on Linux?

I am aware of this. Plus there are constant power attacks when one disconnects the disk while the system is suspended when the key is unlocked on the disk.

But this is a development machine and I figured out that surprisingly non-trivial overhead of LUKS encryption in Linux is not worth it. On the plus side wake up from hibernation is very fast and to mitigate the risk of the above I configured the laptop to hibernate shortly after suspend.


I've run both a Secure Boot/encrypted boot partition NixOS and plain LVM on LUKS archlinux on my Framework and neither had any issues or bugs with hibernating. Just add a resume hook to mkinitcpio and a kernel parameter to the UUID of the swap vol and it works fine.

Making hibernation work on Linux is the pain. Is it even possible on the Framework?

I'm surprised to hear this. Hibernation has worked perfectly since installation on all of my Linux computers for the last ~2 years.

Hibernation and suspend work fine in Linux on hardware designed for Linux.

The sleep then hibernate sounds promising. But is it something you need to configure yourself?

When I had Manjaro on a desktop machine, hibernation worked out of the box and pretty well. I didn't use it that frequently though. But this was without full system encryption.

Good point. I’ve not even tried to hibernate a Linux machine in 10 years though so I have no idea if it works there

I use it too it's not hard to setup and works well (with very few exceptions and if you use a "recent" enough linux kernel, depending on your hardware).

Once hibernation is setup just set systemd [Login]HandleLidSwitch=suspend-then-hibernate and maybe configure the delay with [Sleep]HibernateDelaySec=5min.

Hibernation most times works nice too (even with Full Disk Encryption (FDE)) there is just one gotcha, lockdown mode is currently fundamentally incompatible with hibernation (even through it's docs seem to imply something else, they refer to a not yet existing feature). And some distros enable lockdown mode by default if you use a proper FDE setup. Leading to a lot of confusion about hibernation suposedly not working anymore in linux or being incompatible with FDE.


Yes. I agree. It seems to be getting harder to set up hibernate as an option. Regular (non HN) users might not even figure out that hibernate is a possibility. But it definitely is a better option than sleep.

You can configure hibernation and use it instead.

How is hibernation working for his computer?

There's many OS designs out there.

The Linux kernel is huge, complex and particularly messy in terms of internal structure. This makes even otherwise trivial modifications hard, and complex modifications extremely hard. The development overhead is brutal.

And hibernation just happens to be a scenario that's a nightmare to implement with such a design.


no, they are not (uptimes measured in hours), on windows laptops hibernation has been working fine in windows for a few years. I don't know of any unix different from osx for which the same applies.

Servers and desktop are not really the point of discussion here.


TBF hibernation has never been entirely reliable under Linux due to hardware vendors being difficult (IIUC). Getting it working for me has typically involved trying to make sense of arcane kernel log messages. I never managed to on my current laptop.

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.

next

Legal | privacy