News for hackers. Stuff that matters.
Re:Making hibernation work under Linux Lockdown by ravi-delia on Saturday February 27, 2021 @07:22PM (#26289490)
If you suspend to RAM, and there's some kind of failure, you lose everything, likely leaving some things in a bad state. Hibernation is way less likely to have something like that happen. Of course, the best of both worlds is Suspend then Hibernate.
Re:Making hibernation work under Linux Lockdown by deathanatos on Sunday February 28, 2021 @10:28PM (#26299406)
You lose the running state, as if you'd pulled the battery out. I've had that only happen a few times, ever. Many applications nowadays recover from that. My editor has recovery files, many of my games autosave, my web browser restores the session, etc. It is disruptive, yes, but it's rare enough that I just don't care that much about it. (And definitely not enough that I'd trade the speed of suspend-to-RAM for the reliability of suspend-to-disk.)

(I've had far more issues with the physical connection between the laptop & the battery not being very solid anymore…)

Re:Making hibernation work under Linux Lockdown by fignews on Saturday February 27, 2021 @09:17PM (#26290082)
What do you mean by lose everything? AFAIK, suspend syncs the disks so there really shouldn’t be any half-written data.
Re:Making hibernation work under Linux Lockdown by ravi-delia on Sunday February 28, 2021 @01:48PM (#26295914)
On Linux with SystemD at least, suspend doesn't sync to swap unless you use suspend-then-hibernate, which involves getting hibernation set up. That's exactly what I do, though with a relatively short timer since my laptop is encrypted. Not that realistically anyone stealing my laptop would be able to extract the key if it was suspended, but I just like putting in the password in the stark, pre-boot environment.
Re:Making hibernation work under Linux Lockdown by kljbjklkjhjkl on Saturday February 27, 2021 @10:40PM (#26290489)
Everything being "the contents of ram and the running system image". Suspend to ram doesn't write the contents of ram to disk, it keeps the ram active, constantly refreshing it.

Hybrid Suspend will suspend to ram, then additionally write the contents of ram to disk, so that the image can be resumed in the event of a power failure. The "resume" codepaths in this case are literally the same as if you'd just hibernated.

Re:Making hibernation work under Linux Lockdown by deathanatos on Sunday February 28, 2021 @10:31PM (#26299421)
I interpreted that as "syncs the disks", as in, flushes the buffers. (which it does, I believe, do.) A failure to suspend from RAM isn't that harmful: it's just an unscheduled reboot, as if you'd suddenly removed power.

The wording they're responding to is pretty vague: "lose everything". What is "everything"? E.g., the filesystem state is in good order. And even though RAM gets reset, many applications, like Firefox, will usually simply realize what happened, and recover.

Re:Making hibernation work under Linux Lockdown by ravi-delia on Sunday February 28, 2021 @11:53PM (#26299865)
I meant the system state when you suspended. You're absolutely right that it's just like an unplanned reboot, which isn't the worst thing in the world, but if (for example) you're doing funny things with tmpfs it can cause issues. Or, if you suspend habitually with unsaved progress, you would be in greater danger of losing it. Neither is enormously important, but it's worth noting.