Linux Suspend / Hibernate Functionality Support

Q. Does any Linux distribution support suspend or hibernate functionality?

A. Yes, almost all modern Linux distribution supports suspend or hibernate functionality. In the Linux kernel, Hibernate or suspend-to-disk, suspend-to-ram, suspend-to-file is implemented by swsusp which is built into the 2.6 series.

ADVERTISEMENTS

Hibernate is a feature where the contents of RAM is written to the hard disk (as either a file or on a separate partition) before powering off the system. Later the system can be restored to the state it was in when hibernation was invoked, so that programs can continue executing as if nothing happened. Hibernating and restoring from hibernate is also generally faster than a hard reboot and, if necessary, can be done without user interaction.

I’ve personally tested following distributions:
+ Red Hat Enterprise Linux 5 ( desktop edition )
+ Debian Linux
+ Fedora Linux
+ Ubuntu Linux

How to suspend and hibernate a laptop under Linux

=> Click on Shutdown > Select Suspend or Hibernate as per requirement.

See also:

=> Linux Command: Put Laptop / Netbook In Hibernate / Suspend Mode

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
15 comments… add one
  • Bappa Jun 6, 2008 @ 4:51

    is there any command(e.g, shutdown -xyz) to Hibernate/Suspend Linux without going into init 5(GUI) as we are explicitly use init 3 and never use GUI ?

  • David Brunner Jun 6, 2008 @ 14:32

    Hi,
    On my Ubuntu system, I can run /etc/acpi/hibernate.sh from the command line. Works like a charm.

  • Bappa Jun 9, 2008 @ 10:19

    is there any equivalent command/script for RHEL/CENT OS ?

  • fast Aug 6, 2008 @ 5:11

    the problem seems less a matter of getting into suspend and hybernate modes, but more getting OUT of same.

  • Graeme Nov 20, 2008 @ 7:07

    @fast
    I fully agree. I never experienced a problem going into hibernate or suspend. But getting back out has always been a pain. On my Ubuntu 7.10 system on my laptop, I can finally hibernate, but I still cannot suspend.

  • chika.tambun Nov 4, 2009 @ 14:26

    $ gnome-screensaver-command –lock
    $ echo ‘pmi action hibernate’ | at now + 40 minutes

  • Rob Dec 1, 2010 @ 10:27

    Much easier, without any package:
    echo -n mem > /sys/power/state (Suspend, to RAM)
    echo -n disk > /sys/power/state (Hibernate, to disk)

    • Prasanna Mar 14, 2012 @ 13:26

      hi thanks, i need to turn on system automatically, as my BIOS only supports for wake up on LAN s5 can u hekp me

  • jennifer May 9, 2011 @ 0:46

    I have Linux 2.4, I accidentally hit hibernate instead of shut down, and now when my computer powers up, it is stuck on the inital linux “Ultimate Edition” screen…HELP!!! How do I undo this?

    • Săndel May 25, 2011 @ 11:15

      First:
      Press Esc key to show the boot log (what’s happening.)
      Perhaps it got a corrupted swap or filesystem. It might take a while to verify the partitions for errors. depending on size, and these days hard-drives are big, can take half an hour or more.
      Perhaps fsck is asking you for confirmation on fixing the filesystem. (~y/n questions)
      In case of a bad wake-up from hibernation the mounted filesystems can get pretty damaged. So I wouldn’t be surprised of severe data loss.

      Try your fail-safe power-on option from the boot menu.
      Boot from a live cd/dvd or from a “rescue” mode of the installation cd/dvd.
      Checkup all filesystems with fsck and badbocks.
      Purge de swap partition with mkswap.
      If any thing I wrote is not plain enough or scary :) , please refer to a friend that has good Linux experience.

  • Chankey Pathak Jul 19, 2011 @ 20:50

    When I click on Suspend, it puts my laptop to sleep mode. I want to hibernate it. How can I do it?

    • Săndel Jul 20, 2011 @ 7:34

      Click Suspend to Disk ;)

      For more options, click and hold the Turn Off Computer button to drop-down a tiny menu ;)

      • Chankey Pathak Jul 20, 2011 @ 11:33

        WTF!?

  • arindam Aug 14, 2011 @ 18:42

    hi,
    I’ve a APC ups connected to my ubuntu desktop. I can power off my machine without any problem after a power cut. And then when the ac power is back it gets back in running mode. No problems.
    Now, I’ve another cluster that is connected via a local network. This cluster is powered by another big ups that does not have the capability to connect to the machine and send signal with ac power goes off. Currently, I’ve configured to shutdown the cluster from my desktop (ubuntu) before my desktop powers off after a power cut. However, once power gets back, the cluster does not get back to power because the ups giving power to it might be still up and in that case setting the boot accordingly does not help (system on after power gets back).
    What I want is, my desktop should hibernate the cluster after power cut. Once my desktop is up after power resumes, it should wake the cluster up. Nobody should be able to log in during this time. Only connection it should listen is from my desktop (a fixed ip address). I can do the hibernate part very easily (I’ve tried and it works). However, during hibernate if I try to (that means, any other user tries to) log on, the system gets back to running mode. This should be avoided and only after my desktop asks the cluster to wake up it should be up. How can I do this? Thanks in advance for any help.

  • Ivan Avery Frey Jan 2, 2013 @ 18:03

    What if I’m running Xen and Linux in Dom0 and Win7 in DomU? Is it still possible to hibernate such a system?

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.