Author: Brad Campbell Date: To: dng Subject: Re: [DNG] suspend and hybernate
On 13/04/16 09:27, Steve Litt wrote: > Hi all,
>
> What's the difference between suspend and hybernate?
>
> How can I achieve each condition from the command prompt?
>
> If I achieve each condition from the command prompt, how do I "wake up"
> the computer when I'm ready to use it again?
In practical terms :
Hibernate saves state to disk and powers the machine off. Resume is
effected by powering up the machine and booting the kernel you were
using. Either the kernel or with the help of the initramfs will find the
suspended state and restore it.
Suspend quiesces the machine, powers down accessories it can power down
and put the machine into an ultra low power mode with state preserved in
RAM. The machine will have one or more wakeup devices active and powered
on and hitting one of those will bring the machine back.
Personally I use a hybrid known as s2both. It queisces the machine,
saves state to disk and then suspends to ram. This has the disadvantage
that it takes time to write out to disk, but has the advantage that when
I inevitably forget to plug the machine in, or it runs out of battery
because I've suspended it with 5% battery left and that goes in a day,
when I plug it back in and boot it up it resumes from disk.
All of these options live in pm-utils and can be configured up from
there. I have suspend scripts that unload the wireless driver module
(broadcoms wl driver is not reliable on resume), configures my wakeup
sources so only the power button brings it back (because the Macbook
sometimes issues spurious usb keyboard/mouse wake events that turn your
laptop into a backpack heater), and sets up other niceties that make
things just nicer in general.
I also suspend to encrypted swap, so if I need to resume from disk the
initramfs is required to unlock the swap prior to starting the resume
process.