Even if you give the following command it just gives a fresh system after resume
systemctl hibernate
One needs to enable it in certain scripts for it to function properly. Following are the steps to enable it
– Enable Recovery from a hibernate in grub bootloader settings file
- /etc/default/grub
The contents will be as follows
GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="rhgb quiet" GRUB_DISABLE_RECOVERY="true"
The last line is what matters to us : GRUB_DISABLE_RECOVERY should be set to false. So edit it , replace true to false and it should look like this . If the line is not present , dont worry, just add it
GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="rhgb quiet" GRUB_DISABLE_RECOVERY="false"
– Enable kernel parameters for resume
Enable resume in kernel parameters of grub bootloader so that it resumes from image in the swap partition. So in the following file edit the line for your fedora vmlinuz boot line
/boot/grub2/grub.cfg
Make sure you edit the proper line by checking the uname command for the kernel version. Mine was 64 bit fedora 22 running kernel 4.0.5-300 , so the following line needs to be edited.
linux16 /boot/vmlinuz-4.0.5-300.fc22.x86_64 root=/dev/sda1 ro rhgb quiet
At the end of the above line add resume=/dev/sda3, assuming ofcourse sda3 is your swap partition
linux16 /boot/vmlinuz-4.0.5-300.fc22.x86_64 root=/dev/sda1 ro rhgb quiet resume=/dev/sda3
Thats it, now reboot the system and hibernate away!! 🙂 let me know in comments any issues you face.
Note: FC-22 mutter package gives some issues once after resume, just update it to version 3.6.3-2
Still does not work. Same error
LikeLike
What error do you get?
LikeLike
Hello ..
thanks for pointing me the right direction.
Actually rather than adding resume=/dev/sda3 directly in the /boot/grub2/grub.cfg manually I believe the right way is modifying the value of the GRUB_CMDLINE_LINUX in the /etc/default/grub and regenerate the configuration with the grub2-mkconfig command:
GRUB_CMDLINE_LINUX=”rhgb quiet resume=/dev/sda3″
grub2-mkconfig -o /boot/grub2/grub.cfg
This way the configuration would survive installation / update of new kernel or regenerating the grub2-mkconfig.
Best regards
Michal Ambroz
LikeLiked by 1 person
Hmm, nope it didn’t work on Fedora 25 atleast, fresh resume 😦
LikeLike