April 2, 2017
What do you do if your Linux machine hibernates and it isn’t able to wake up? I’m willing to bet that, at first, you panic and then you turn to Google and that’s probably why you are here.
Background
Suspend and hibernate are great when they work. Historically this has been a sore spot for Linux. I recently found myself in a position where my laptop wasn’t able to wake from hibernate. This happened because I was running on batteries and stepped away from the machine. The system automatically went into hibernate mode. Unfortunately it wasn’t able to wake from that mode.
Deadends
Like anyone else I immediately turned to Google. What I found wasn’t
terribly helpful. I learned that no_console_suspend
would prevent
the console from blanking. That confirmed my suspicion that the
machine was having trouble resuming from hibernate. Unfortunately I
still couldn’t get a console even in single user mode and even passing
init=/bin/sh
to the kernel.
Options
My machine wasn’t too customized so I was starting to think about
reinstalling but I didn’t want to give up. I found another kernel
parameter, resume=
which let’s you specify where the software
suspend image comes from. Normally this is the sawp partition.
There’s a related kernel parameter, hibernate
, which would also have
worked. My solution was to pass resume=/dev/null
to the kernel.
This forced it to ignore the hibernate image. If I had known about
the hibernate=noresume
option I would have used this as it is more
appropriate. The documentation for this option states: “Don’t check
if there’s a hiberation image present during boot”.
Solution
If you find yourself in the situation where you can’t come out of
hibernate in Linux pass hibernate=noresume
. If that doesn’t work
for you pass resume=/dev/null
which will make waking from
hibernation fail and launch your system normally.