How to Enable Hybrid Suspend in Ubuntu ?

H

What is Suspend option in Ubuntu and how is it useful ?

suspend optionIf you have been using Ubuntu for some time you might be aware of the “Suspend” option. It is similar to the “Sleep” option in windows. Whenever you press this button system pushes the existing state of your machine to RAM and turns off power to all other hardware but it will continue to provide power to RAM as it is volatile memory whose data will be cleared when the power is unplugged to RAM. The advantage of RAM over Hard disk is that the system can access the memory in RAM faster than that in the Hard drive and whenever you try to restore the PC the data from RAM will be pulled and system restores the previous state of the machine.

What is Hybrid Suspend and What are its advantages over Normal Suspend ?

As discussed above whenever you suspend your machine,  your machines state will be stored to RAM which is volatile. That means you cannot restore the previous state of the machine when you turn of your PC at this point of time. As soon as power supply is gone, the data in RAM will be gone hence no point of restoring previous machine’s state.

Here comes “Hybrid Suspend” into the play. Through this option you can normally suspend your machine and say if you haven’t restored the machine’s state in some amount of time you can make the system to move the data in RAM to Hard Drive and power off the machine. Which is nothing but the concept of Hibernation.

Alternatively you can use hibernate option before suspending your machine if you feel that you will be away for long time but having this hibernate option through suspend will be for good.

How to Enable Hybrid Suspend in Ubuntu ?

To enable “Hybrid Suspend” option in ubuntu first we need to know if your system supports hybrid suspend or not ( Typically if your system can support hibernation then it should also be able to support hybrid suspend as well )  type the following command in your terminal which can be opened through short cut “Ctrl + Alt + T”

[bash]sudo pm-is-supported –suspend-hybrid && echo "hybrid suspend supported" || echo "hybrid suspend is not supported"[/bash]

The result of this command will be echoed on to the screen as you can see in the screen shot below

hybrid suspend supported
If your system supports the Hybrid Suspend, let us go ahead and change the normal suspend mode to hybrid suspend mode and give a specific time interval after which it should be hibernated. To do this we need to edit the configuration file of hybrid suspend mode. Open the configuration file located in /etc/pm/config.d/00-use-suspend-hybrid using your favorite editor. here in this case I am using gedit alternatively you can use any editor. To open it using gedit type the following command in terminal box

[bash]sudo gedit /etc/pm/config.d/00-use-suspend-hybrid[/bash]

and Add the following lines of code to the empty file for the system to use hybrid suspend mode instead of normal suspend mode and save it.

[bash]# Always use suspend_hybrid instead of suspend
if [ "$METHOD" = "suspend" ]; then
METHOD=suspend_hybrid
fi
PM_HIBERNATE_DELAY=900 # time in seconds until hibernate (suspend to disk) occurs;[/bash]

where 900 in above code is the time until which system shouldn’t go to hibernating mode and you can change the value of it to your choice.

That is all, Now your system is enabled with Hybrid Suspend.

Source: AskUbuntu

About the author

pavankumar.p1990
By pavankumar.p1990