Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1348  / 2 Years ago, fri, january 28, 2022, 5:47:02

I would like hybrid suspend to act a certain way.



If I add the code



# Always use suspend_hybrid instead of suspend
if [ "$METHOD" = "suspend" ]; then
METHOD=suspend_hybrid
fi
PM_HIBERNATE_DELAY=XX


to



/etc/pm/config.d/00-use-suspend-hybrid


where XX is the number of seconds until the computer hibernates, does XX indicate the number of seconds until the computer writes the state of the RAM to the disk, or until the computer actually goes into hibernation mode, or both?



I would like to use a hybrid suspend in which when I close the lid of my laptop, the state of the RAM is both written to the disk and kept in the RAM at the time that I close the lid of the laptop, and then after the XX seconds the computer actually goes into hibernate (drops the contents of the RAM from the RAM). If this is not what the above code does, can someone give me the code that will do this? Thanks!



Code taken from this question:
How do I use pm-suspend-hybrid by default instead of pm-suspend?



UPDATE: I tested this for myself by simply taking out the battery of my laptop about thirty seconds after using hybrid suspend by closing the lid. When I started back up, the system booted as it would normally. This also occurred when I omitted the



PM_HIBERNATE_DELAY=XX


line and when I ran



sudo pm-suspend-hybrid


from the terminal. Therefore, It can be concluded that the system does NOT write the state of the RAM to the disk as soon as it suspends.



Am I correct in this assumption?



If I am, I would like to know how to make hybrid suspend write the state of the RAM to the disk when the computer suspends, not after the timer expires.



I know that this question is out of vanity more than anything, but it has been posted for a month with not even a comment. Is there someplace anybody knows of that I can go where I might be able to come up with a solution for myself?


More From » 12.10

 Answers
7

From http://www.webupd8.org/2012/11/how-to-use-hybrid-suspend-in-ubuntu.html (paraphrased) there appears to be two different versions of hybrid sleep. One that suspends to RAM and disk at the same time; and another that first suspends to RAM, then wakes the computer up after PM_HIBERNATE_DELAY to then suspend to disk and (seemingly) switch off the computer. The former seems to be dependent on Kernel version, and only supported on 3.6+. I understand Ubuntu 12.10 uses Linux kernel 3.5, so the latter seems to be your only option sans upgrading (which I suppose may have already been done).



You don't state what you set PM_HIBERNATE_DELAY to in your tests, per the page referenced in your question, but I believe, according to the pm-suspend/pm-hiberate/pm-suspend-hybrid man page, removing an explicit definition of it, would set the wake-to-hibernate-then-switch-off sequence delay to be 15 minutes (900 seconds):



PM_HIBERNATE_DELAY [=900]
If you are using kernel suspend/resume and invoke
pm-suspend-hybrid, this environment variable controls how many
seconds the system will wait after going into suspend _before waking
back up and hibernating_. By default, this is set to 900 seconds (15
minutes).


You also don't mention if you have, so would also suggest it would be prudent to check, from the page referenced in your question, that hybrid suspend is supported by your hardware, by establishing the result of sudo pm-is-supported --suspend-hybrid ; echo $? is 0



Also, perhaps of note, apparently there is a bug in KDE 4.3 where if Hybrid suspend isn't available, standard suspend to RAM is used (not sure if this is without explicit notice)... http://www.informit.com/articles/article.aspx?p=1565701&seqNum=3. This article also has some other useful info related to sleep/hybrid sleep/the like.



P.S A different implementation of Dlego Callejo's answer, is at http://www.cyberciti.biz/faq/linux-command-to-suspend-hibernate-laptop-netbook-pc


[#34173] Saturday, January 29, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
njuash

Total Points: 402
Total Questions: 125
Total Answers: 98

Location: Jersey
Member since Sun, Dec 4, 2022
1 Year ago
njuash questions
Wed, Jun 8, 22, 11:53, 2 Years ago
Wed, Nov 30, 22, 11:42, 1 Year ago
Mon, May 30, 22, 04:33, 2 Years ago
Mon, Apr 10, 23, 03:40, 1 Year ago
;