{"id":318,"date":"2011-09-25T17:29:36","date_gmt":"2011-09-25T14:29:36","guid":{"rendered":"http:\/\/www.held.org.il\/blog\/?p=318"},"modified":"2011-11-12T13:51:18","modified_gmt":"2011-11-12T10:51:18","slug":"reviving-the-hibernate-feature-on-debuntu","status":"publish","type":"post","link":"http:\/\/www.held.org.il\/blog\/2011\/09\/reviving-the-hibernate-feature-on-debuntu\/","title":{"rendered":"Reviving the hibernate feature on Debuntu"},"content":{"rendered":"<p>My laptop's battery had just died. It made me realize how much I depend on it, for changing my working location, either when computer is awake or asleep for many hours. Without a battery, the <em>sleep<\/em> (aka suspend-to-ram) feature is less useful, for the tiniest power interruption would kill it.<!--more--><\/p>\n<p>So I had to go back and use the old <em>hibernate <\/em>feature<em><\/em> (aka suspend-to-disk), as powering off-and-on the computer on daily basis is not a reasonable option. But, <em>hibernate<\/em> never worked for me for quite a while - clicking in my GNOME \"System -&gt; Shut Down -&gt; Hibernate\" did nothing more than a hard-to-notice flicker. So I had to research this:<\/p>\n<ul>\n<li><strong>Insight #1:<\/strong> suspending\/hibernating from GNOME 2 indirectly triggers the tools: <strong><em>pm-suspend<\/em>, <em>pm-hibernate <\/em><\/strong>(from pm-utils package). Running <em>pm-hibernate<\/em> manually from a terminal\u00c2\u00a0 revealed the problem I had by printing the error to screen (and also later I found it in <em>\/var\/log\/pm-suspend.log)<\/em>:<\/li>\n<\/ul>\n<blockquote>\n<pre>s2disk: Could not stat the resume device file. Reason: No such file or directory<\/pre>\n<\/blockquote>\n<ul>\n<li><strong>Insight #2:<\/strong> pm-utils make use of uswsusp (userspace software suspend utils): <em>s2disk<\/em>, <em>s2ram<\/em>, <em>s2both<\/em><\/li>\n<li><strong>Insight #3:<\/strong> <em>\/etc\/initramfs-tools\/conf.d\/resume <\/em>defines the resume device file (swap device) for the initrd.<\/li>\n<li><strong>Insight #4:<\/strong> If swap device is a device-mapper device (such as a Logical Volume on LVM) - one should be using <strong>RESUME=\/dev\/mapper\/&lt;name&gt;.<\/strong> Notations such as UUID=&lt;ID&gt; or \/dev\/dm-nn <strong>don't<\/strong> seem to work, triggerring the following error on boot:<\/li>\n<\/ul>\n<blockquote>\n<pre>resume: could not stat the resume device file '# RESUME=\/dev\/sda6\r\nUUID=UUID=038df595-f105-4653-a2a4-7c051f90dd10'\r\n             Please type in the full path name to try again or press\r\nENTER to boot the system:<\/pre>\n<\/blockquote>\n<ul>\n<li><strong>Insight #5:<\/strong> <em>dpkg-reconfigure uswsusp<\/em> reconfigures the whole thing, and regenerates the initrd (thus applying the newly defined RESUME device).<\/li>\n<\/ul>\n<p>To summarize, that's how I solved it:<\/p>\n<ul>\n<li>updated <em>\/etc\/initramfs-tools\/conf.d\/resume<\/em> to:<\/li>\n<\/ul>\n<blockquote><p>RESUME=\/dev\/mapper\/myvg-swapvol<\/p><\/blockquote>\n<ul>\n<li>Ran <em>dpkg-reconfigure uswsusp\u00c2\u00a0<\/em><\/li>\n<li>Tested it by running <em>pm-hibernate<\/em><\/li>\n<\/ul>\n<p><strong>Additional tip:<\/strong> <em>suspend-hybrid<\/em> is very cool - both writes to disk and RAM: if RAM power survived, wake-up process would be instantaneous. Otherwise, it'll behave as regular hibernate. To use it, simply use <em>pm-suspend-hybrid<\/em>. GNOME2 doesn't seem to have it in its GUI, I haven't checked GNOME3 out yet.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My laptop&#8217;s battery had just died. It made me realize how much I depend on it, for changing my working location, either when computer is awake or asleep for many hours. Without a battery, the sleep (aka suspend-to-ram) feature is less useful, for the tiniest power interruption would kill it.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[32,198,47,166,203,167,165,119],"_links":{"self":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/318"}],"collection":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/comments?post=318"}],"version-history":[{"count":0,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}