When I boot with a resume=.. option to the kernel and an initrd built with a -h option, userland tools (say, batti) offer me the choice of hibernation; when I boot without them it does not.

Where is the fact that I have a system capable of hibernate/resume exposed for these tools to find that out? (This is on Slackware, in case this is init-specific.)


One way to do this is via the /sys/power interface. The usual way to induce hibernation (used by various higher level tools) is to write to a couple of the fields there:

echo shutdown > /sys/power/disk
echo disk > /sys/power/state

I believe the first one sets the methodology and the second one triggers the change.1 However, if you read from these nodes, you get a list of possibities:

> cat /sys/power/disk
platform [shutdown] reboot suspend

> cat /sys/power/state
freeze standby mem disk

Since shutdown and disk are available, the machine can be put into hibernation.

1 You can also set platform on /sys/power/disk to do the same thing via the system's ACPI hardware, presuming the driver works properly, and echo mem > /sys/power/state puts the machine into suspend (state saved to ram).

  • Cool, thanks. I've written to those files for years and never thought to read from them. – Bandrami Jun 8 '14 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.