Hibernate does not restore session

Tillus

New Member
Joined
Mar 16, 2019
Messages
7
Reaction score
3
Credits
0
Hey
icon_smile.gif
. I use a MacBook Pro Late 12, Ubuntu 18.04, i3wm and I have configured 12 Gb of swap (thats 1.5x my RAM size).

Unfortunately when my laptop tries to hibernate (like with sudo pm-hibernate) it just turns off completely and when I boot again it does not restore the session. I tried out several things, I even installed Manjaro in dual boot, but its just the same in manjaro. I could post a lot of my outputs, but I don't know which is important. I can easily add more stuff if requested.

Code:
~$ inxi -Fxz
System:    Host: t-MacBookPro Kernel: 4.18.0-16-generic x86_64 bits: 64 gcc: 7.3.0 Desktop: i3 4.14.1
          Distro: Ubuntu 18.04.2 LTS
Machine:   Device: laptop System: Apple product: MacBookPro10 2 v: 1.0 serial: N/A
          Mobo: Apple model: Mac-AFD8A9D944EA4843 v: MacBookPro10 2 serial: N/A
          UEFI: Apple v: 274.0.0.0.0 date: 09/17/2018
Battery    BAT0: charge: 66.6 Wh 97.7% condition: 68.1/73.9 Wh (92%) model: SMP bq20z451 status: Full
          hidpp__0: charge: N/A condition: NA/NA Wh model: Logitech Performance MX status: Discharging
CPU:       Dual core Intel Core i5-3210M (-MT-MCP-) arch: Ivy Bridge rev.9 cache: 3072 KB
          flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 9976
          clock speeds: max: 3100 MHz 1: 1197 MHz 2: 1197 MHz 3: 1197 MHz 4: 1197 MHz
Graphics:  Card: Intel 3rd Gen Core processor Graphics Controller bus-ID: 00:02.0
          Display Server: x11 (X.Org 1.19.6 ) driver: intel Resolution: [email protected], [email protected]
          OpenGL: renderer: Mesa DRI Intel Ivybridge Mobile version: 4.2 Mesa 18.2.2 Direct Render: Yes
Audio:     Card Intel 7 Series/C216 Family High Definition Audio Controller
          driver: snd_hda_intel bus-ID: 00:1b.0
          Sound: Advanced Linux Sound Architecture v: k4.18.0-16-generic
Network:   Card-1: Broadcom and subsidiaries NetXtreme BCM57786 Gigabit Ethernet PCIe bus-ID: 02:00.0
          IF: N/A state: N/A speed: N/A duplex: N/A mac: N/A
          Card-2: Broadcom and subsidiaries BCM4331 802.11a/b/g/n driver: bcma-pci-bridge bus-ID: 03:00.0
          IF: wlp3s0b1 state: up mac: <filter>
Drives:    HDD Total Size: 121.3GB (40.4% used)
          ID-1: /dev/sda model: APPLE_SSD_SM128E size: 121.3GB temp: 23C
Partition: ID-1: / size: 45G used: 35G (84%) fs: ext4 dev: /dev/sda6
          ID-2: swap-1 size: 12.00GB used: 0.00GB (0%) fs: swap dev: /dev/sda5
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 50.0C mobo: N/A
          Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 252 Uptime: 15:40 Memory: 2702.0/7851.5MB Init: systemd runlevel: 5 Gcc sys: 7.3.0
          Client: Shell (fish) inxi: 2.3.56

I am a bit desperate because this is such an important function (otherwise I have to worry about my battery dying all the time) - so anyone trying to help is appreciated.
smiley-faces-80.gif
 


G'day @Tillus and welcome to linux.org :)

Can you please give us the output of (a hash precedes my comments, not commands):

Code:
cat /etc/default/grub

# and

cat /etc/fstab

Cheers

Chris Turner
wizardfromoz:)
 
Yeah sure, thanks for tuning in.
Code:
~$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=43766461-abe9-4c26-bae0-1bfa64e85c2e"
#GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/sda4"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=237a5daa-b88b-4548-bdd7-5f3d56ee6037 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=67E3-17ED  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda4 during installation
UUID=43766461-abe9-4c26-bae0-1bfa64e85c2e none            swap    sw              0       0
So quick explanation: The default was #GRUB_CMDLINE_LINUX_DEFAULT="quiet splash". I read somewhere that I should put my swap as resume in there, so I tried it, but it did not change anything.
 
Haha, you were one step ahead of me :)

Tillus is this a dual boot with Mac OSX or is Ubuntu the only OS? Looks like it from the inxi output.

If the former, does hibernate work out of the Mac?

Oh, and perhaps a silly question, did you update grub following the change to /etc/default/grub?

Code:
sudo update-grub

Wizard
 
Hey Charis,
thanks for your hint. I tried that out, but it did not change anything unfortunately.
@Wizard: I did update my grub before. What I also did is `sudo update-initramfs -u -k all` after I put `RESUME=UUID=43766461-abe9-4c26-bae0-1bfa64e85c2e` in `/etc/initramfs-tools/conf.d/resume`.
Yes I had macos also on my machine but somehow I killed it. :( Because I wanted to try out manjaro on my machine (in which hibernate also not works) I shrinked my macos partition in macos, but after the reboot I could not boot into macos anymore. But as I remember did hibernate work just well in macos.

Thanks, you guys also have a nice day!!:rolleyes:
 
Tillus, G'day :)

Can you please give me the outputs for the following

Code:
df -Th

#and

swapon -s

#and

sudo blkid

Cheers

Wizard
 
G'morning from Germany :D
Thanks for the input, here's the output:
Code:
~$ df -Th
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  3,9G     0  3,9G   0% /dev
tmpfs          tmpfs     786M  1,7M  784M   1% /run
/dev/sda6      ext4       45G   38G  4,6G  90% /
tmpfs          tmpfs     3,9G   60M  3,8G   2% /dev/shm
tmpfs          tmpfs     5,0M  4,0K  5,0M   1% /run/lock
tmpfs          tmpfs     3,9G     0  3,9G   0% /sys/fs/cgroup
/dev/loop2     squashfs   35M   35M     0 100% /snap/gtk-common-themes/818
/dev/loop3     squashfs   91M   91M     0 100% /snap/core/6350
/dev/loop1     squashfs  2,3M  2,3M     0 100% /snap/gnome-calculator/260
/dev/loop0     squashfs   91M   91M     0 100% /snap/core/6405
/dev/loop4     squashfs  141M  141M     0 100% /snap/gnome-3-26-1604/74
/dev/loop5     squashfs   35M   35M     0 100% /snap/gtk-common-themes/1122
/dev/loop6     squashfs   15M   15M     0 100% /snap/gnome-logs/45
/dev/loop7     squashfs  174M  174M     0 100% /snap/spotify/34
/dev/loop9     squashfs  141M  141M     0 100% /snap/gnome-3-26-1604/82
/dev/loop8     squashfs  148M  148M     0 100% /snap/skype/66
/dev/loop10    squashfs  124M  124M     0 100% /snap/caprine/19
/dev/loop11    squashfs  123M  123M     0 100% /snap/caprine/20
/dev/loop12    squashfs   92M   92M     0 100% /snap/core/6531
/dev/loop13    squashfs   36M   36M     0 100% /snap/gtk-common-themes/1198
/dev/loop14    squashfs   13M   13M     0 100% /snap/gnome-characters/139
/dev/loop15    squashfs  3,8M  3,8M     0 100% /snap/gnome-system-monitor/57
/dev/loop16    squashfs  141M  141M     0 100% /snap/gnome-3-26-1604/78
/dev/loop17    squashfs  272M  272M     0 100% /snap/pycharm-community/117
/dev/sda1      vfat      197M   21M  177M  11% /boot/efi
tmpfs          tmpfs     786M   12K  786M   1% /run/user/1000
~$ swapon -s
Filename                Type        Size    Used    Priority
/dev/sda5                                  partition    11718652    0    -2
~$ sudo blkid
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/loop7: TYPE="squashfs"
/dev/sda1: LABEL="EFI" UUID="67E3-17ED" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="8d29cc48-0136-473b-9e2c-5dfbfcfedadf"
/dev/sda2: UUID="c812da9d-f52c-3f8f-a43a-37bf172bea69" LABEL="disk0s2" TYPE="hfsplus" PARTLABEL="Apple_HFS_Untitled_2" PARTUUID="277bba19-1a45-407c-8920-ce49022a041e"
/dev/sda3: UUID="1437a5e6-b1e5-4402-a481-92ac93f085c3" TYPE="ext4" PARTUUID="674ef786-f54f-4008-a5a3-449d128e66f3"
/dev/sda4: UUID="49B8-547B" TYPE="vfat" PARTUUID="554dfeae-63ab-4b1b-b34b-fdcaadc00ff2"
/dev/sda5: UUID="43766461-abe9-4c26-bae0-1bfa64e85c2e" TYPE="swap" PARTUUID="55c4fe97-e4bc-414b-a3d5-4cab4aada245"
/dev/sda6: UUID="237a5daa-b88b-4548-bdd7-5f3d56ee6037" TYPE="ext4" PARTUUID="7cf737f0-0e89-4b68-b585-b0df4223a1d8"
/dev/loop8: TYPE="squashfs"
/dev/loop9: TYPE="squashfs"
/dev/loop10: TYPE="squashfs"
/dev/loop11: TYPE="squashfs"
/dev/loop12: TYPE="squashfs"
/dev/loop13: TYPE="squashfs"
/dev/loop14: TYPE="squashfs"
/dev/loop15: TYPE="squashfs"
/dev/loop16: TYPE="squashfs"
/dev/loop17: TYPE="squashfs"
Thanks for the patience so far! See you, Till
 
OK, thanks for that. Next up is output for

Code:
cat /sys/power/state

I'll explain what I am looking for here, rather than just having you robotically follow orders :)

With the df -Th command, I was establishing that your Linux is using the "usual" EXT4 file system, rather than say BTRFS, often used with RAID systems and other (which does not support suspension).

swapon state was to see that it is on, else we would turn it on.

blkid established that the UUID for the partition was that of your Swap partition, not of your root partition, which is the one your OS is on. Hence the details in your /etc/default/grub are correct.

The command in this Post is to establish that your kernel supports hibernation, and via what methods.

Cheers

Wiz - I have a road trip today, so may be unavailable for some hours.
 
Yo, ok good to know whats going on :)
Code:
~$ cat /sys/power/state
freeze mem disk
So I guess hibernation should be enabled for my kernel via freeze.

Enjoy you road trip! I will sleep now for some hours so I'll be unavailable as well. ;)
 
Hey,

I really though I had made that final post. :rolleyes:
I just want to explain for future readers what solved the problem for me: I actually just installed a clean version of Manjaro i3 (therefore I had to delete my whole macos and any other OS) on my machine. And voila, now it works. Still do not know exactly what the problem was, but found a fix :)
 
Last edited:
I've never liked hibernation in any OS. Suspend to RAM does the job a lot better and in Linux case, it restores the session EVEN in the case of power loss. I stress on "even" because Windows loses everything stored in memory in case of power loss and one has to reboot it twice in a row in order to make it work again.
 
I've never liked hibernation in any OS. Suspend to RAM does the job a lot better and in Linux case, it restores the session EVEN in the case of power loss. I stress on "even" because Windows loses everything stored in memory in case of power loss and one has to reboot it twice in a row in order to make it work again.
Maybe we have different definitions for different words, but in my case the normal suspend to ram is not saving the state on powerloss (and additionally consumes like 10% of battery over night). Otherwise I would not need hibernation as well :D
 
in my case the normal suspend to ram is not saving the state on powerloss
This may depend on the distro or on the power settings or even on the fact that it's a laptop. On the computer in my signature so far almost every distro I have tried restores session after power loss. Only about Arch IDK whether it does because I never got this far with it.
 

Members online


Top