How to enable hibernation with swap partition on Linux Mint 19

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
rene
Level 16
Level 16
Posts: 6225
Joined: Sun Mar 27, 2016 6:58 pm

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by rene »

Yes, that's "suspend" rather than "hibernate". The latter is the actual same as powering down the system fully just with an image of your RAM saved to, in the case of Linux, the swap space. On powering up again the kernel detects the image and rather than boot normally loads it into RAM directly. The former keeps at least your RAM powered so as to keep it from losing its contents; still uses (more) actual power, that is.

User avatar
BG405
Level 8
Level 8
Posts: 2190
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by BG405 »

TI58C wrote:
Sun Apr 14, 2019 12:34 am
When I close the laptop, everything goes down. USB-sticks are powered down and can be safely removed.
After re-opening, have to hit power-button to start again.
I hope you replace those USB devices before powering back up? Otherwise you may lose data which was cached but not yet committed to the device.
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 8GB - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------K7S5A AMD 1.2GHz - LM17.3 Xfce 32 & WinXP-Pro
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE ...

TI58C
Level 4
Level 4
Posts: 354
Joined: Tue Jul 18, 2017 5:57 am

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by TI58C »

@Rene, BG405,

Thanks. Understand the difference now. As for USB-sticks, alway use sync and wait until blinking led stops, then suspend. And do replace them. Just for transport it's easier if these things are nog "sticking out". But I like the way I can just close laptop, go somwhere else and have it back up in a few seconds. Could never get that to work reliably on 17.3.

Will read more about hibernation and give it a try

Robert
Linux is like my late labrador lady-dog: loyal and loving if you treat her lady-like, disbehaving princess if you don't.

rene
Level 16
Level 16
Posts: 6225
Joined: Sun Mar 27, 2016 6:58 pm

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by rene »

TI58C wrote:
Mon Apr 15, 2019 4:57 am
Will read more about hibernation and give it a try
If you do, be aware that it's not enabled in Ubuntu and Mint by default for a reason. Has significant issues especially in the (nvidia) graphics card context. Basically, works if you're lucky, does not and lets you experience the joys of closed source, binary drivers first hand if you're... well, also "lucky", even if now in a different manner :)

TI58C
Level 4
Level 4
Posts: 354
Joined: Tue Jul 18, 2017 5:57 am

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by TI58C »

@rene,

OK, thanks for the "heads up!"

Robert
Linux is like my late labrador lady-dog: loyal and loving if you treat her lady-like, disbehaving princess if you don't.

ablaszczyk
Level 1
Level 1
Posts: 4
Joined: Thu Mar 28, 2013 11:23 am

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by ablaszczyk »

@goebbe Thank You. Works perfectly.

since2019
Level 2
Level 2
Posts: 54
Joined: Fri Sep 13, 2019 5:50 pm
Location: Honduras

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by since2019 »

made all that and the laptop computer turns off and not the hibernation mode with the command or the hibernation button

User avatar
pebcak
Level 1
Level 1
Posts: 28
Joined: Mon Dec 16, 2019 4:59 am

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by pebcak »

goebbe wrote:
Fri Jul 13, 2018 9:21 am
This howto should guide you, when setting up hibernation and using a separate swap partition.
@goebbe

Thank you for this tutorial! It worked for me on a Dell Vostro 5471 and Mint 19.3.

sergueidob
Level 1
Level 1
Posts: 2
Joined: Thu Jun 15, 2017 8:23 pm

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by sergueidob »

Many thanks! Worked great on HP Envy 15 CTO & Mint 19.3

Frankus333
Level 3
Level 3
Posts: 145
Joined: Mon Jan 06, 2014 10:33 pm
Location: Brisbane Australia

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by Frankus333 »

Thanks everybody for the interesting comments and variations in this thread.

My variation, just based on what I have used to modify settings files in the past in LM19.x, was to create the policy file with:

Code: Select all

sudo -H xed /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
and paste in the longer form original version of the file content provided by the OP. I then saved the file, and it worked, on three different machines with LM19.3 XFCE (Intel NUC8i3BEH and HP15 laptop, both 64 bit, and a eeePC 1000H, 32bit, all running kernal 5.3.0-40).

Interestingly, on the eeePC, when running kernal 4.15.0-88, it would hibernate, but not resume fully. It would get to the point of reading all segments of the stored image, but either stop, or reboot into a normal restart.

This was initially a concern for the eeePC, is it seemed unable to run with kernal 5.3.0-40 (no networking worked). However, after playing around with re-installing the previously working kernal 5.3.0-28, which was then upgraded to 5.3.0-40 by the Update Manager, and there was a Linux firmware upgrade in there at some point, the 5.3.0-40 kernal now works on this machine, so I have had a good day ultimately! Thanks again.

I edited the grub file using;

Code: Select all

sudo xed /etc/default/grub
and whenever I make changes to this file, it seems necessary for me to use a two step process to ensure the changes to grub actually get into the boot loader;

Code: Select all

sudo update-grub
followed by:

Code: Select all

sudo grub-install /dev/sd[letter (if BIOS) or letter number (if UEFI) of partition with boot loader]
If the second step is not done, the changes don't seem to show up in the grub boot menu, which I notice whenever a kernal upgrade is done.
LM19.3XFCE 64bit; Intel NUC8i3BEH, 4GB RAM, CPU Dual Core i3-8109U Kaby Lake 3.6GHz, 1TB HDD, triple boot Win 10 Home, LM19.3XFCE. LM18.3KDE 64 bit; HP 15 laptop, 4GB RAM, CPU Celeron dual core N2840 2.5GHz, 500GB HDD (triple boot LM19.3XFCE, Win 8.1)

adarshonline01
Level 1
Level 1
Posts: 1
Joined: Sat Apr 04, 2020 10:34 am

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by adarshonline01 »

yes worked:)

BrunoMiranda
Level 3
Level 3
Posts: 170
Joined: Thu Jun 24, 2010 2:22 pm

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by BrunoMiranda »

I need help on this one on Mint 19.3.
I had everything working (including hibernation to a swap partition) and then tried the method to hibernate to a file. It worked but I want to revert it now into hibernating to a swap partition and it's not working through the GUI.

I've tried the methods described in this post but pressing the hibernation button blinks the screen black for a moment and then it comes back, with no hibernation. Nothing is written in /var/log.

The system can and it is actually hibernating if I run sudo s2disk from the terminal but I also want it to do it from the GUI and configure the power button to make the system hibernate.

So does anyone know how to make the hibernate button call sudo s2disk?

Thanks!
Bye for now,
Bruno


(Always backup before you fvckup :mrgreen: )

bellalistair
Level 1
Level 1
Posts: 1
Joined: Wed Jul 01, 2020 4:59 pm

Re: How to enable hibernation with swap partition on Linux Mint 19

Post by bellalistair »

I see the comment regarding the Grub menu appearing with a 30 sec timeout after resume and the advice to fix by setting GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT
Changing the recordfail timeout just stops the grub menu appearing differently in the event of a boot failure, given the default timeout is zero this may be somewhat unwise.

The root cause is a resume script now being in the wrong location.
See https://savannah.gnu.org/bugs/?56603
(https://bugs.debian.org/cgi-bin/bugrepo ... bug=959537 will eventually be fixed and work through to Mint.)

/etc/pm/sleep.d/10_grub-common
should now be in
/lib/system/system-sleep/10_grub-common with a slight adjustment to the trigger from thaw to post
This is the script that unsets the fail record in grub in the event of a successful resume and hence avoids the long timeout next boot.

Cheers,

Post Reply

Return to “Tutorials”