2

My Ubuntu is 14.04 on Thinkpad T400.

I try to run the following command for hibernation:

sudo pm-hibernate 

It flashes and then return back to normal. Running pm-suspend-hybrid also flashes and return back to normal. only sudo pm-suspend will work. How shall I hibernate then?

pm-is-supported --hibernate and pm-is-supported --suspend-hybrid don't return anything, which I assumes to mean my system supports both?

Does the output of pm-is-supported also imply BIOS allow all sleep modes?


Here is the output of /proc/acpi/wakeup.

Device  S-state   Status   Sysfs node
LID   S3    *enabled   platform:PNP0C0D:00
SLPB      S3    *enabled   platform:PNP0C0E:00
UART      S3    *disabled
IGBE      S4    *enabled   pci:0000:00:19.0
EXP0      S4    *disabled  pci:0000:00:1c.0
EXP1      S4    *disabled  pci:0000:00:1c.1
EXP2      S4    *disabled
EXP3      S4    *disabled  pci:0000:00:1c.3
EXP4      S4    *disabled  pci:0000:00:1c.4
PCI1      S4    *disabled  pci:0000:00:1e.0
USB0      S3    *enabled   pci:0000:00:1d.0
USB3      S3    *enabled   pci:0000:00:1a.0
USB5      S3    *enabled   pci:0000:00:1a.2
EHC0      S3    *enabled   pci:0000:00:1d.7
EHC1      S3    *enabled   pci:0000:00:1a.7
HDEF      S4    *disabled  pci:0000:00:1b.0
  1. Does the wakeup file apply equally to both suspend and hibernate? If yes, then does your method solve the problem for hibernate, given that I can suspend but can't hibernate?

  2. Do "enabled" and "disabled" mean if the device can or cannot wake up the OS?

  3. how shall I try to change the wakeup file to see if it makes hibernate possible?

David Foerster
  • 36,264
  • 56
  • 94
  • 147
Tim
  • 25,177

2 Answers2

1

Some device is waking up your machine immediately.

You can show all devices which can wakeup and those states with cat /proc/acpi/wakeup

# cat /proc/acpi/wakeup
Device  S-state   Status   Sysfs node
PS2K      S4    *disabled
PS2M      S4    *disabled
UAR1      S4    *disabled  pnp:00:06
P0P1      S4    *disabled
RP01      S4    *disabled  pci:0000:00:1c.0
PXSX      S4    *disabled
RP02      S4    *disabled
PXSX      S4    *disabled
RP03      S4    *disabled
PXSX      S4    *disabled
RP04      S4    *disabled
PXSX      S4    *disabled
RP07      S4    *disabled  pci:0000:00:1c.6
PXSX      S4    *enabled   pci:0000:06:00.0
RP08      S4    *disabled
PXSX      S4    *disabled
PEG0      S4    *disabled  pci:0000:00:01.0
PEGP      S4    *disabled
PEG1      S4    *disabled
PEG2      S4    *disabled
PEG3      S4    *disabled
RP05      S4    *disabled  pci:0000:00:1c.4
PXSX      S4    *disabled  pci:0000:03:00.0
RP06      S4    *disabled  pci:0000:00:1c.5
PXSX      S4    *disabled  pci:0000:04:00.0
GLAN      S4    *disabled
EHC1      S4    *disabled  pci:0000:00:1d.0
EHC2      S4    *disabled  pci:0000:00:1a.0
XHC   S4    *disabled  pci:0000:00:14.0
HDEF      S4    *disabled  pci:0000:00:1b.0
PWRB      S4    *enabled   platform:PNP0C0C:00

In my case it turned out that USB (EHC1 and EHC2) was responsible for the wakeup. You can toggle each device with echo <DEVICE> | sudo tee /proc/acpi/wakeup where <DEVICE> is the device name from the list above.

Try to disable all but PWRB and PXSX and check if this helps. If so you can re-enable one after an other until you found the device which is waking up.

EDIT


copy this script into gedit

#!/bin/sh
#Prevent USB and Ethernet from waking up
for i in "IGBE" "USB0" "USB3" "USB5" "EHC0" "EHC1"; do
echo $i | sudo tee /proc/acpi/wakeup
done

save it to ~/prev_wakeup and then run chmod 755 ~/prev_wakeup and ~/prev_wakeup. Next try to go into hibernate and check if this helped.

If so you can add this to your /etc/rc.local

#Prevent USB and Ethernet from waking up
for i in "IGBE" "USB0" "USB3" "USB5" "EHC0" "EHC1"; do
echo $i > /proc/acpi/wakeup
done
Germar
  • 6,377
  • 2
  • 26
  • 39
  • Thanks. (1)Does the wakeup file apply equally to both suspend and hibernate? If yes, then does your method solve the problem for hibernate, given that I can suspend but can't hibernate? (2) I don't have PWRB and PXSX in the wakeup file. (see my edit to my post) (3) Do "enabled" and "disabled" mean if the device can or cannot wake up the OS? – Tim May 10 '15 at 03:42
  • (1)AFAIK it apply for both suspend and hibernate. Didn't recognize suspend is working for you. (2)You have LID (closing the lid) SLPB (sleep button) which should be kept enabled (3)correct – Germar May 10 '15 at 19:21
0
  • If you don't have a swap partition create one. By using any gparted(for linux) or any aomei/mini partition tools for windows(if you're dual booting).
  • Make that partition in ext2 file system.
  • After creating the partition you have to format it.
  • Before formatting we shall know it's label like sda1 or sda2 etc. for this type in terminal sudo blkid or sudo lsblk. It gives UUID and type of partition.
  • After knowing the partition type sudo mkswap /dev/sdxx this formats the partition.
  • Then you have to mount the partition by sudo swapon -U UUID
  • Then open gedit /etc/fstab and add this line to that file- UUID=XXX none swap sw 0 0
  • If you want to use your swap for hibernating then you need to update the UUID in /etc/initramfs-tools/conf.d/resume with this content RESUME=UUID=xxx.
    Don't forget to sudo update-initramfs -u

To enable hibernate option in power menu-

  • sudo gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

  • Type in it-


    [Re-enable hibernate by default in upower]
    Identity=unix-user:*
    Action=org.freedesktop.upower.hibernate
    ResultActive=yes

    [Re-enable hibernate by default in logind]
    Identity=unix-user:*
    Action=org.freedesktop.login1.hibernate
    ResultActive=yes

  • Type sudo killall unity-panel-service

  • Hibernate option enabled in power menu
arvind
  • 161
  • following your answer, I have cryptswap1 in fstab, ive also noted after i entry my pass phrase on boot up i get a notice to wait or skip while swap is mounted which i do wait. should i change /dev/mapper/cryptswap1 to the uuid or leave it as is? – CodingInTheUK Feb 19 '16 at 11:29
  • This may help you [link]http://askubuntu.com/questions/341979/what-to-do-about-the-disk-drive-for-dev-mapper-cryptswap1-is-not-ready-yet-or – arvind Feb 19 '16 at 12:16
  • Thank you for the link, i couldnt follow those pages as for some reason there wasnt a separate swap partition. As it was a fresh install bar for some emails that were still on the mail server I have reinstalled without encrytion, hopefully i will get to the bottom of my lack of hibernation now. Thanks again. – CodingInTheUK Feb 20 '16 at 20:06