Ask Your Question
5

Hibernate on Fedora 21 does not resume

asked 2015-04-24 01:31:33 -0600

steckerhalter gravatar image

updated 2015-04-24 08:44:12 -0600

mether gravatar image

I experience this issue for a few weeks now. It started appearing after yum update (I'm not sure which upgrade it started with).

So from GNOME when I choose to hibernate the system it looks like it does everything (saves the memory to disk and then powers off) but when I turn it on again it just boots like if I hadn't hibernated at all.

I'm not really sure how to analyze the issue so if you could give me some hint I would be glad...

edit retag flag offensive close merge delete

7 Answers

Sort by » oldest newest most voted
1

answered 2015-04-24 13:56:51 -0600

sebotic gravatar image

I am experiencing the exact same thing on a 2015 Thinkpad X1 carbon. Hibernate seems to work fine when sending the machine into hibernate, but then, when starting the machine, it does not resume, it just boots into gnome. The only error message I could find, was in dmesg 'Volume was not properly unmounted. Some data may be corrupt. Please run fsck.'

does anyone have a hint how to solve this? btw: suspend to ram works without problems, after disabling the intel deep sleep mode in bios.

I run fedora 21 with kernel 3.19-200, all updates installed

edit flag offensive delete link more

Comments

I finally made progress on this matter. For some reason, the installation did not add the kernel option "resume". For the system to resume on boot, the kernel requires the option resume=<path_to_swap_partition>. With that, it works on my thinkpad X1, but unfortunately, this does not seem to be very stable. If I have several programs opened (several GB of ram used), the resume from hibernate does not work, but just ends up with a black screen. A bios or kernel or driver update seems to be required

More on hibernate: https://wiki.archlinux.org/index.php/...

sebotic gravatar imagesebotic ( 2015-04-24 19:54:54 -0600 )edit
1

answered 2015-04-24 14:31:42 -0600

baoboa gravatar image

it could be a problem of acpi

what did the journal say ?

journalctl -b -1

does the kernel changed ? or the firmware ?

yum history ; yum history info XX

edit flag offensive delete link more
1

answered 2015-04-24 22:24:34 -0600

snowolfe gravatar image

updated 2015-04-24 22:50:51 -0600

Aside from the kernel items mentioned above, another thing to be aware of is Fedora/Linux uses the swap partition when hibernating (suspend to disk).

Note: Suspend to RAM (or sleep mode) does not require disk space, just an ongoing power supply (AC or Battery).

What this means is that the swap partition needs to be at least the same size as the amount of RAM you have - that is, if you have 8 GiB of RAM, then your swap partition must be at least 8 GiB in size, probably 12 GiB.

The reason for the extra space in the swap partition is in case your swap partition is already in use when you choose to hibernate. The kernel will offload all of your RAM in to swap, and you are already consuming swap space - there must be enough space for both sets of data.

I would question if you really even need to hibernate?

Historically, hibernation has been used for two reasons:

  1. The operating system was slow to boot up and and often slow to shutdown - consequently it was often quicker to hibernate and then resume, particularly with RAM sizes less than 4-6 GiB. However, most recent versions of Fedora are very quick to shutdown and boot, negating this issue.
  2. You want to preserve the current state of applications and work in order to resume again quickly when you need to. If you have a reliable battery on your laptop (with reasonable charge remaining), or you have AC plugged in, then you can suspend to RAM and then resume when you need to. This is very quick typically, and requires no swap/disk space. Remember to save any unsaved work first, just in case you do loose power while in sleep mode.

I have used suspend to RAM for several years now (on both laptops and desktops), without any issues - including on laptops over an entire weekend. Both suspending and resuming only take 1-2 seconds each - much quicker than hibernate/resume or the shutdown/restart cycle, and for me has been just as reliable. Just something to think about.

edit flag offensive delete link more

Comments

1

I think that reason #2 is reason enough when the hibernation is expected to last a significant time of the remaining battery power or even exceed it. I've been using hibernation and suspend depending on the situation at hand.

jmt gravatar imagejmt ( 2015-06-17 08:48:40 -0600 )edit
6

answered 2015-04-27 04:32:06 -0600

sepperl gravatar image

I got the same issue after the update. As it was mentioned above it is connected to the kernel parameter "resume".

My solution is very simple. We add the "resume" to the default grub parameter and rebuild the grub2 config. This will also work for future kernel updates. But when grub2 gets an update this needs to be done again.

That's how it is done:

1) Get the device file of the swap partition. You could use blkid, gparted or parted. I used blkid. Just run:

blkid

This is what I got, I removed all the other lines. This is the important one.

/dev/sda6: LABEL="LINUX_SWAP" UUID="1805fa26-010c-4d8f-9009-deb2c21b77c1" TYPE="swap" PARTLABEL="Basic data partition" PARTUUID="c78f919c-0978-43c8-9f00-1ed497050281"

So my swap partition is on /dev/sda6

2) Edit the default file /etc/default/grub. You need to modify the line which includes GRUB_CMDLINE_LINUX. It should look something like this GRUB_CMDLINE_LINUX="rhgb quiet" Use your tool to edit the file. You need to be root or use sudo. I used vi.

sudo vi /etc/default/grub

Change the line so that it looks like this. Replace the XXX with the device file of your swap partition

GRUB_CMDLINE_LINUX="rhgb quiet resume=/dev/XXX"

3) We need to rebuild the grub2 config file. Since I have EFI I need to update the EFI config. If you also have EFI, just run

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

If you have a non-EFI system, please read here https://fedoraproject.org/wiki/GRUB_2... . Looks like you need to run "grub2-mkconfig -o /boot/grub2/grub.cfg". But I did not try it, so I don't know if that works. Maybe someone could post a confirmation that it works.

edit flag offensive delete link more

Comments

1

I'm running a non-EFI system, kernel-4.0.4-303.f22.x86_64. I was experiencing the same problem described in the OP -- dysfunctional hibernation after system updates. The problem was resolved after making the changes you suggested to /etc/default/grub and running sudo grub2-mkconfig -o /boot/grub2/grub.cfg, as you also suggested.

mattymaloney gravatar imagemattymaloney ( 2015-06-11 06:30:36 -0600 )edit

Ii works but I have to add the resume command manually to grub.cfg beacuse if I use grub2-mkconfig the resulting grub.cfg file didn't enable my wireless device. Any suggestion on that ?

earlati gravatar imageearlati ( 2015-10-10 12:25:04 -0600 )edit

How would you go about this if you are using LVM? Using Fedora 22 if it matters.

Lord_Vader gravatar imageLord_Vader ( 2015-10-22 08:56:59 -0600 )edit

This is the bugreport. It is still present in Fedora 23! https://bugzilla.redhat.com/show_bug....

erik gravatar imageerik ( 2016-02-16 18:11:57 -0600 )edit
0

answered 2015-11-28 07:11:57 -0600

pawel.skura gravatar image

Hi guys,

Maybe I dug out an old post, but I've got hibernate/suspend related problem with my fedora 23 installation.

When it hibernates, everything seems fine, it goes to suspended mode. When wake up, it attempts to resume but it goes to hibernate state again in just a few seconds, no matter if I log back in or not, it just goes back not letting me use the system.

I'm using quite ancient laptop - LG LW-20, with Pentium M 2.00 GHz and 2 gigs of RAM. Everything else works great and snappy. Running xfce with compton windows manager.

Is there any solution to solve my problem? Maybe it's kernel-related as well. I don't know. These are my first steps with fedora, been using ubuntu before. Just thinking of turning off hibernate mode completely, but it's just half the solution here as sometimes I need my laptop to wake up asap when I show something to client.

Please help! :)

edit flag offensive delete link more
0

answered 2016-01-24 16:38:29 -0600

stephenw gravatar image

updated 2017-06-08 13:51:24 -0600

This worked for me on Fedora 22:

Find the path for the default kernel:

~]# grubby --default-kernel /boot/vmlinuz-4.2.8-200.fc22.x86_64

~]# grubby --info /boot/vmlinuz-4.2.8-200.fc22.x86_64 index=0 kernel=/boot/vmlinuz-4.2.8-200.fc22.x86_64 args="ro rd.luks.uuid=luks-8ad68390-93be-4d33-a378-24fb75ab795f rd.lvm.lv=fedora_dhcp-4-151/swap rd.lvm.lv=fedora_dhcp-4-151/root rhgb quiet LANG=en_US.UTF-8"

Find the path to the "swap" partition:

~]# blkid [output omitted] /dev/mapper/fedora_dhcp--4--151-swap: UUID="0e282f5b-cfeb-44aa-9179-5f16b0356635" TYPE="swap" [output truncated]

Update the grub menu using the full path to the "swap" partition:

~]# grubby --args=resume=/dev/mapper/fedora_dhcp--4--151-swap --update-kernel /boot/vmlinuz-4.2.8-200.fc22.x86_64

Check all is well:

~]# grubby --info /boot/vmlinuz-4.2.8-200.fc22.x86_64 index=0 kernel=/boot/vmlinuz-4.2.8-200.fc22.x86_64 args="ro rd.luks.uuid=luks-8ad68390-93be-4d33-a378-24fb75ab795f rd.lvm.lv=fedora_dhcp-4-151/swap rd.lvm.lv=fedora_dhcp-4-151/root rhgb quiet LANG=en_US.UTF-8 resume=/dev/mapper/fedora_dhcp--4--151-swap" root=/dev/mapper/fedora_dhcp--4--151-root initrd=/boot/initramfs-4.2.8-200.fc22.x86_64.img title=Fedora (4.2.8-200.fc22.x86_64) 22 (Twenty Two)

EDIT: On second thoughts, just using grubby --info=DEFAULT should be quicker then my first two commands. Also, grubby --update-kernel=DEFAULT could replace my first two and fourth commands. See "Making Persistent Changes to a GRUB 2 Menu Using the grubby Tool" in the System Administrator's Guide for more info.

edit flag offensive delete link more
0

answered 2016-05-08 11:45:47 -0600

It did work perfectly thank you

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2015-04-24 01:31:33 -0600

Seen: 9,834 times

Last updated: Jun 08 '17