I have been able to enable hibernation on Ubuntu, using s2disk, and it works everytime I press the power button.

But I sometimes have system crashes or power down because of battery level, which will (obviously) skip the hibernation state.

Is there a way to always keep a copy of the RAM on the hibernation swap file, so that when it crashes, or shuts down because of lack of power, it can always restore back to its last saved state ?

  • What would be the benefit of restoring a crashed system state? Most desktop environments allow you to configure actions like suspend or hibernate when the battery is critically low. – danzel Jul 5 '18 at 19:36
  • I wouldn't want to restore to the crashed state, but to the latest stable state before the crash – Thierry J. Jul 6 '18 at 10:09
  • How would you determine the "last stable state"? I don't think that is possible (as of today). If it was, operating systems would already automatically recover from a crash. – danzel Jul 6 '18 at 11:43
  • If I understand correctly, when hibernating, the content of the RAM is copied to a swap file. If that is done, say every 5 minutes, then even on a crash, there would be a RAM snapshot to restore from. Actually, on OSX, when the computer crashes, all windows are restored with their last state (almost...) – Thierry J. Jul 6 '18 at 13:29

Your Answer

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

Browse other questions tagged or ask your own question.