How to enable hibernation with swap partition on Linux Mint 19

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
User avatar
ngiampaoli
Level 1
Level 1
Posts: 13
Joined: Tue Aug 11, 2015 12:17 pm
Location: Cordoba, Argentina

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

Post by ngiampaoli »

Thank you for the tutorial
It works great. :D
User avatar
Valsodar
Level 4
Level 4
Posts: 364
Joined: Thu Jul 19, 2018 11:30 pm
Location: Sofia, Bulgaria
Contact:

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

Post by Valsodar »

Just a question: why would anyone to enable hibernation? It's a too slow process to be useful.
Core i7-4770, Palit GTX 1660 Ti, 32GB DDR3 RAM, Firefox, Arch LTS w/ Cinnamon 5.2.7
My Linux group on Telegram
Avatar & desktop: https://ibb.co/album/GFx0yV
gm10

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

Post by gm10 »

Valsodar wrote: Fri Aug 10, 2018 7:44 pm Just a question: why would anyone to enable hibernation? It's a too slow process to be useful.
Not really, only takes seconds, in particular with an SSD. Depends on what you do with your machine but for me it's certainly faster than closing everything down, saving every document, and re-opening it all again next time you start the computer. It's been my default for years on both Linux and Windows machines.
User avatar
Valsodar
Level 4
Level 4
Posts: 364
Joined: Thu Jul 19, 2018 11:30 pm
Location: Sofia, Bulgaria
Contact:

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

Post by Valsodar »

Nah, I don't close anything. Just suspend it to RAM. Takes 2 seconds to powerdown/wake up.
Core i7-4770, Palit GTX 1660 Ti, 32GB DDR3 RAM, Firefox, Arch LTS w/ Cinnamon 5.2.7
My Linux group on Telegram
Avatar & desktop: https://ibb.co/album/GFx0yV
gm10

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

Post by gm10 »

Valsodar wrote: Sat Aug 11, 2018 5:54 am Nah, I don't close anything. Just suspend it to RAM. Takes 2 seconds to powerdown/wake up.
Sure, you could also just leave it running, but neither of those solutions actually turns your computer off to the point where you can cut the power.

Maybe I should have clarified that in my original response: I want to turn my computer off. :D
User avatar
BG405
Level 9
Level 9
Posts: 2507
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

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

Post by BG405 »

gm10 wrote: Sat Aug 11, 2018 6:51 am neither of those solutions actually turns your computer off to the point where you can cut the power.
Exactly. Although I use suspend (sleep) by default on my D255E netbook, Hibernate is an essential function in the event of low or critical battery levels when one can't access a mains socket. Especially so with the Dell (server machine) in case of a power cut, as its battery is well past its use-by date.

Suspend / sleep still drains the battery, albeit rather slowly, meaning the Acer has to be plugged in when I get home in order to avoid unnecessary battery wear.
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
kryssb

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

Post by kryssb »

Hello,

I am sorry to say this doesn't work for me. I do get the button but hibernation does not work at all.
I have been running LMDE2 for more than one year and then decided to move to Mint 19 to get newer software. LMDE2 with kernel 3.16 had some glitches but in the last 6 months hibernation worked like a charm. I tend to believe the problem is in kernel 4.15, because all I get is freezing the machine in a coma state, when I have to push the power button to kill it. When rebooting, the system has a fresh start. Remembering what the disk activity was like in LMDE2 and checking what it is like now, I would say the hibernation process never writes a single byte to the swap partition. Of course I put the UUID of the swap partition (checked also by GParted) into the grub file. I would appreciate suggestions, here below is the output of /var/log/pm-suspend.log. Thanks in advance

EDIT I installed stable kernel 4.9.124 and hibernation works flawlessly again. Although I really don't feel expert enough to point fingers, it looks that in this respect there's a regression in the kernel between 4.9 and 4.15, which might affect only some machines.

Code: Select all

Initial commandline parameters: 
mar 28 ago 2018, 00.26.24, CEST: Running hooks for hibernate.
Running hook /usr/lib/pm-utils/sleep.d/000kernel-change hibernate hibernate:
/usr/lib/pm-utils/sleep.d/000kernel-change hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/000record-status hibernate hibernate:
/usr/lib/pm-utils/sleep.d/000record-status hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/00logging hibernate hibernate:
Linux pc-studio 4.15.0-33-generic #36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Module                  Size  Used by
nvidia_drm             40960  1
nvidia_modeset       1114112  5 nvidia_drm
nvidia              14364672  180 nvidia_modeset
snd_hda_codec_hdmi     49152  4
drm_kms_helper        172032  1 nvidia_drm
drm                   401408  4 nvidia_drm,drm_kms_helper
ipmi_devintf           20480  0
uvcvideo               86016  0
videobuf2_vmalloc      16384  1 uvcvideo
joydev                 24576  0
videobuf2_memops       16384  1 videobuf2_vmalloc
videobuf2_v4l2         24576  1 uvcvideo
videobuf2_core         40960  2 uvcvideo,videobuf2_v4l2
hid_tmff               16384  0
snd_usb_audio         196608  1
input_leds             16384  0
videodev              184320  3 uvcvideo,videobuf2_core,videobuf2_v4l2
ff_memless             16384  1 hid_tmff
snd_usbmidi_lib        32768  1 snd_usb_audio
media                  40960  2 uvcvideo,videodev
arc4                   16384  2
snd_hda_codec_idt      57344  1
snd_hda_codec_generic    73728  1 snd_hda_codec_idt
snd_hda_intel          40960  4
snd_hda_codec         126976  4 snd_hda_intel,snd_hda_codec_idt,snd_hda_codec_hdmi,snd_hda_codec_generic
snd_hda_core           81920  5 snd_hda_intel,snd_hda_codec,snd_hda_codec_idt,snd_hda_codec_hdmi,snd_hda_codec_generic
snd_hwdep              20480  2 snd_hda_codec,snd_usb_audio
snd_pcm                98304  5 snd_hda_intel,snd_hda_codec,snd_usb_audio,snd_hda_core,snd_hda_codec_hdmi
snd_seq_midi           16384  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            32768  2 snd_seq_midi,snd_usbmidi_lib
snd_seq                65536  2 snd_seq_midi_event,snd_seq_midi
ipmi_msghandler        53248  2 nvidia,ipmi_devintf
snd_seq_device         16384  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer              32768  2 snd_seq,snd_pcm
fb_sys_fops            16384  1 drm_kms_helper
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
gpio_ich               16384  0
intel_rapl             20480  0
x86_pkg_temp_thermal    16384  0
intel_powerclamp       16384  0
coretemp               16384  0
kvm_intel             212992  0
rt2800pci              16384  0
kvm                   593920  1 kvm_intel
rt2800mmio             16384  1 rt2800pci
rt2800lib             114688  2 rt2800mmio,rt2800pci
rt2x00pci              16384  1 rt2800pci
rt2x00mmio             16384  2 rt2800mmio,rt2800pci
irqbypass              16384  1 kvm
rt2x00lib              53248  5 rt2800lib,rt2x00pci,rt2800mmio,rt2x00mmio,rt2800pci
crct10dif_pclmul       16384  0
crc32_pclmul           16384  0
ghash_clmulni_intel    16384  0
pcbc                   16384  0
mac80211              778240  3 rt2800lib,rt2x00pci,rt2x00lib
snd                    81920  23 snd_hda_intel,snd_hwdep,snd_seq,snd_hda_codec,snd_hda_codec_idt,snd_usb_audio,snd_timer,snd_rawmidi,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_usbmidi_lib,snd_seq_device,snd_pcm
aesni_intel           188416  0
aes_x86_64             20480  1 aesni_intel
crypto_simd            16384  1 aesni_intel
glue_helper            16384  1 aesni_intel
cryptd                 24576  3 crypto_simd,ghash_clmulni_intel,aesni_intel
intel_cstate           20480  0
intel_rapl_perf        16384  0
cfg80211              622592  2 rt2x00lib,mac80211
lpc_ich                24576  0
eeprom_93cx6           16384  1 rt2800pci
mei_me                 40960  0
soundcore              16384  1 snd
mei                    90112  1 mei_me
shpchp                 36864  0
mac_hid                16384  0
sch_fq_codel           20480  6
parport_pc             36864  0
ppdev                  20480  0
lp                     20480  0
parport                49152  3 lp,parport_pc,ppdev
ip_tables              28672  0
x_tables               40960  1 ip_tables
autofs4                40960  2
btrfs                1122304  0
xor                    24576  1 btrfs
zstd_compress         163840  1 btrfs
raid6_pq              114688  1 btrfs
dm_mirror              24576  0
dm_region_hash         20480  1 dm_mirror
dm_log                 20480  2 dm_mirror,dm_region_hash
uas                    24576  0
usb_storage            69632  2 uas
hid_generic            16384  0
usbhid                 49152  0
hid                   118784  3 hid_tmff,hid_generic,usbhid
ahci                   36864  3
r8169                  86016  0
libahci                32768  1 ahci
mii                    16384  1 r8169
              total        used        free      shared  buff/cache   available
Mem:       16405528     1544412    13090336       84452     1770780    14807808
Swap:      16777212           0    16777212
/usr/lib/pm-utils/sleep.d/00logging hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate:
/usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate: success.

Running hook /etc/pm/sleep.d/10_grub-common hibernate hibernate:
/etc/pm/sleep.d/10_grub-common hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/40inputattach hibernate hibernate:
/usr/lib/pm-utils/sleep.d/40inputattach hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/50unload_alx hibernate hibernate:
/usr/lib/pm-utils/sleep.d/50unload_alx hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/60_wpa_supplicant hibernate hibernate:
Selected interface 'wlp5s0'
OK
/usr/lib/pm-utils/sleep.d/60_wpa_supplicant hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/75modules hibernate hibernate:
/usr/lib/pm-utils/sleep.d/75modules hibernate hibernate: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/90clock hibernate hibernate:
/usr/lib/pm-utils/sleep.d/90clock hibernate hibernate: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/94cpufreq hibernate hibernate:
/usr/lib/pm-utils/sleep.d/94cpufreq hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/95anacron hibernate hibernate:
Warning: Stopping anacron.service, but it can still be activated by:
  anacron.timer
/usr/lib/pm-utils/sleep.d/95anacron hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/95hdparm-apm hibernate hibernate:
/usr/lib/pm-utils/sleep.d/95hdparm-apm hibernate hibernate: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/95led hibernate hibernate:
/usr/lib/pm-utils/sleep.d/95led hibernate hibernate: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate:
nVidia binary video drive detected, not using quirks.
/usr/lib/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/99video hibernate hibernate:
/usr/lib/pm-utils/sleep.d/99video hibernate hibernate: success.

mar 28 ago 2018, 00.26.25, CEST: performing hibernate
Initial commandline parameters: 
mar 28 ago 2018, 20.24.32, CEST: Running hooks for hibernate.
Running hook /usr/lib/pm-utils/sleep.d/000kernel-change hibernate hibernate:
/usr/lib/pm-utils/sleep.d/000kernel-change hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/000record-status hibernate hibernate:
/usr/lib/pm-utils/sleep.d/000record-status hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/00logging hibernate hibernate:
Linux pc-studio 4.15.0-33-generic #36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Module                  Size  Used by
nvidia_drm             40960  1
nvidia_modeset       1114112  5 nvidia_drm
nvidia              14364672  183 nvidia_modeset
snd_hda_codec_hdmi     49152  4
drm_kms_helper        172032  1 nvidia_drm
joydev                 24576  0
uvcvideo               86016  0
videobuf2_vmalloc      16384  1 uvcvideo
videobuf2_memops       16384  1 videobuf2_vmalloc
videobuf2_v4l2         24576  1 uvcvideo
videobuf2_core         40960  2 uvcvideo,videobuf2_v4l2
snd_usb_audio         196608  1
input_leds             16384  0
videodev              184320  3 uvcvideo,videobuf2_core,videobuf2_v4l2
hid_tmff               16384  0
ff_memless             16384  1 hid_tmff
snd_usbmidi_lib        32768  1 snd_usb_audio
media                  40960  2 uvcvideo,videodev
drm                   401408  4 nvidia_drm,drm_kms_helper
ipmi_devintf           20480  0
ipmi_msghandler        53248  2 nvidia,ipmi_devintf
fb_sys_fops            16384  1 drm_kms_helper
snd_hda_codec_idt      57344  1
snd_hda_codec_generic    73728  1 snd_hda_codec_idt
syscopyarea            16384  1 drm_kms_helper
arc4                   16384  2
snd_hda_intel          40960  4
snd_hda_codec         126976  4 snd_hda_intel,snd_hda_codec_idt,snd_hda_codec_hdmi,snd_hda_codec_generic
snd_hda_core           81920  5 snd_hda_intel,snd_hda_codec,snd_hda_codec_idt,snd_hda_codec_hdmi,snd_hda_codec_generic
snd_hwdep              20480  2 snd_hda_codec,snd_usb_audio
snd_pcm                98304  5 snd_hda_intel,snd_hda_codec,snd_usb_audio,snd_hda_core,snd_hda_codec_hdmi
snd_seq_midi           16384  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            32768  2 snd_seq_midi,snd_usbmidi_lib
snd_seq                65536  2 snd_seq_midi_event,snd_seq_midi
snd_seq_device         16384  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer              32768  2 snd_seq,snd_pcm
gpio_ich               16384  0
sysfillrect            16384  1 drm_kms_helper
intel_rapl             20480  0
x86_pkg_temp_thermal    16384  0
intel_powerclamp       16384  0
coretemp               16384  0
sysimgblt              16384  1 drm_kms_helper
kvm_intel             212992  0
kvm                   593920  1 kvm_intel
irqbypass              16384  1 kvm
crct10dif_pclmul       16384  0
crc32_pclmul           16384  0
ghash_clmulni_intel    16384  0
pcbc                   16384  0
rt2800pci              16384  0
rt2800mmio             16384  1 rt2800pci
rt2800lib             114688  2 rt2800mmio,rt2800pci
rt2x00pci              16384  1 rt2800pci
aesni_intel           188416  0
rt2x00mmio             16384  2 rt2800mmio,rt2800pci
rt2x00lib              53248  5 rt2800lib,rt2x00pci,rt2800mmio,rt2x00mmio,rt2800pci
aes_x86_64             20480  1 aesni_intel
crypto_simd            16384  1 aesni_intel
glue_helper            16384  1 aesni_intel
mac80211              778240  3 rt2800lib,rt2x00pci,rt2x00lib
cryptd                 24576  3 crypto_simd,ghash_clmulni_intel,aesni_intel
intel_cstate           20480  0
snd                    81920  23 snd_hda_intel,snd_hwdep,snd_seq,snd_hda_codec,snd_hda_codec_idt,snd_usb_audio,snd_timer,snd_rawmidi,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_usbmidi_lib,snd_seq_device,snd_pcm
intel_rapl_perf        16384  0
cfg80211              622592  2 rt2x00lib,mac80211
lpc_ich                24576  0
mei_me                 40960  0
eeprom_93cx6           16384  1 rt2800pci
mei                    90112  1 mei_me
soundcore              16384  1 snd
shpchp                 36864  0
mac_hid                16384  0
sch_fq_codel           20480  6
parport_pc             36864  0
ppdev                  20480  0
lp                     20480  0
parport                49152  3 lp,parport_pc,ppdev
ip_tables              28672  0
x_tables               40960  1 ip_tables
autofs4                40960  2
btrfs                1122304  0
xor                    24576  1 btrfs
zstd_compress         163840  1 btrfs
raid6_pq              114688  1 btrfs
dm_mirror              24576  0
dm_region_hash         20480  1 dm_mirror
dm_log                 20480  2 dm_mirror,dm_region_hash
uas                    24576  0
usb_storage            69632  2 uas
hid_generic            16384  0
usbhid                 49152  0
hid                   118784  3 hid_tmff,hid_generic,usbhid
ahci                   36864  3
r8169                  86016  0
libahci                32768  1 ahci
mii                    16384  1 r8169
              total        used        free      shared  buff/cache   available
Mem:       16405528      629492    15006976       20268      769060    15479252
Swap:      16777212           0    16777212
/usr/lib/pm-utils/sleep.d/00logging hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate:
/usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate: success.

Running hook /etc/pm/sleep.d/10_grub-common hibernate hibernate:
/etc/pm/sleep.d/10_grub-common hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/40inputattach hibernate hibernate:
/usr/lib/pm-utils/sleep.d/40inputattach hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/50unload_alx hibernate hibernate:
/usr/lib/pm-utils/sleep.d/50unload_alx hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/60_wpa_supplicant hibernate hibernate:
Selected interface 'wlp5s0'
OK
/usr/lib/pm-utils/sleep.d/60_wpa_supplicant hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/75modules hibernate hibernate:
/usr/lib/pm-utils/sleep.d/75modules hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/90clock hibernate hibernate:
/usr/lib/pm-utils/sleep.d/90clock hibernate hibernate: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/94cpufreq hibernate hibernate:
/usr/lib/pm-utils/sleep.d/94cpufreq hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/95anacron hibernate hibernate:
Warning: Stopping anacron.service, but it can still be activated by:
  anacron.timer
/usr/lib/pm-utils/sleep.d/95anacron hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/95hdparm-apm hibernate hibernate:
/usr/lib/pm-utils/sleep.d/95hdparm-apm hibernate hibernate: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/95led hibernate hibernate:
/usr/lib/pm-utils/sleep.d/95led hibernate hibernate: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate:
nVidia binary video drive detected, not using quirks.
/usr/lib/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate: success.

Running hook /usr/lib/pm-utils/sleep.d/99video hibernate hibernate:
/usr/lib/pm-utils/sleep.d/99video hibernate hibernate: success.

mar 28 ago 2018, 20.24.33, CEST: performing hibernate
xGuy
Level 3
Level 3
Posts: 113
Joined: Fri Jan 29, 2016 3:56 pm

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

Post by xGuy »

Many thanks for this excellent HowTo which worked fine for me on Mint 19.

One issue I hit was that when restarting from a hibernation, the GRUB screen had a 30 second timeout rather than the 3 seconds I had set.

After a little investigation I found that inserting the following line into /etc/default/grub fixed this :-
GRUB_RECOVERYFAIL_TIMEOUT GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT

This might be down to my environment which is an Asus EeePC Netbook used as a Media Server. The internal HDD layout is as supplied with Windows XP with a standard Windows MBR. Mint 19 is installed on a USB HDD with GRUB2 on its MBR. So booting Mint19 involves pressing ESC a couple of times to get the USB HDD in the Boot Device List.

This set up was simply to prove that Mint 19 64 bit Cinnamon with Wine could run an old version of iTunes just as well as Windows XP can. Which it does (although 1GB RAM is a bit tight).
Last edited by xGuy on Mon Nov 12, 2018 12:26 pm, edited 1 time in total.
gm10

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

Post by gm10 »

xGuy wrote: Sun Nov 11, 2018 2:58 pm After a little investigation I found that inserting the following line into /etc/default/grub fixed this :-
GRUB_RECOVERYFAIL_TIMEOUT=$GRUB_TIMEOUT
I believe you mean GRUB_RECORDFAIL_TIMEOUT ?
xGuy
Level 3
Level 3
Posts: 113
Joined: Fri Jan 29, 2016 3:56 pm

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

Post by xGuy »

Many thanks for pointing out that serious error! It could potentially have caused a lot of wasted time for someone.

I will try to be more accurate in future. Normally I would copy paste from the actual file but in this case I couldn't do that - not even if logged in remotely via VNC. I guess I could have pulled the file over with SSH.

Apologies to anyone misled but hopefully your timely intervention will have forestalled that possibility.
madhatter

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

Post by madhatter »

goebbe wrote: Fri Jul 13, 2018 9:21 am 1a. Copy your UUID of the swap partition from fstab:

Code: Select all

cat /etc/fstab
1b. Add the boot option to grub (your boot loader):

Code: Select all

xed admin:///etc/default/grub
Add the following boot option "resume=UUID=putYourSwapUUIDhere" to GRUB_CNMDLINE_LINUX_DEFAULT.
Example:

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=putYourSwapUUIDhere"
Note that you have to copy your UUID from fstab to replace putYourSwapUUIDhere.

Save the grub file and update grub:

Code: Select all

sudo update-grub
instead of the uuid, i had to add the mount point. which for me was:

Code: Select all

/dev/mapper/mint--vg-swap_1 none
this is probably because i have an encrypted file system with lvm. other than that, excellent howto, thank you! i don't like to reboot that often because i like to keep applications open. also, hibernation keeps encryption intact, good thing.
IC4

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

Post by IC4 »

I've done what the tutorial suggests. systemctl hibernate + restarting is same as shutdown and restarting.
I know the machine can hibernate since Ubuntu 16 used to do that, and win10 still can.
secure boot is disabled.
I'm losing my mind.
I tried with swapfile at first, reinstalled mint altogether to make a swap partition, I wish to love linux again, please help me not to give up on it :-}
free -m
total used free shared buff/cache available
Mem: 15936 1944 12976 170 1014 13543
Swap: 15558 0 15558
gm10

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

Post by gm10 »

IC4 wrote: Wed Dec 19, 2018 12:16 pm I tried with swapfile at first, reinstalled mint altogether to make a swap partition,
You can also hibernate with a swap file, this is just not the thread for that.
IC4 wrote: Wed Dec 19, 2018 12:16 pm I know the machine can hibernate since Ubuntu 16 used to do that, and win10 still can.
And yet neither of them are Mint 19. Just because another operating system can hibernate that doesn't mean that your current one can. Hibernation issues are usually because of drivers, and those depend on firmware and kernel primarily. Your log files may provide information on where the problem lies exactly. Although your problem description makes it just as likely that you simply made a mistake. Please discuss the details in a thread of your own though.
User avatar
zcot
Level 9
Level 9
Posts: 2833
Joined: Wed Oct 19, 2016 6:08 pm

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

Post by zcot »

Just an addition to the discussion, you would want to make sure your BIOS/UEFI is set to use the S3/S4 state if compatible, using power management scheme ACPI stuff. Some older hardware might not support it, or might not have it configured for use.

If default mode is S1 and the motherboard is not even capable of S4, or it is not authorized to use S3/S4, then full hibernate will surely not be able to work.

I'm just guessing that any modern pc, and especially laptops will have these settings appropriately capable and configured, but not necessarily on older desktops for sure. So, just have a check in the BIOS.

If you can only get S3 then you will only be able to suspend instead of hibernate.
fkasmani
Level 2
Level 2
Posts: 78
Joined: Wed Mar 03, 2010 6:11 am

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

Post by fkasmani »

Hello,

This is my partition setup as per gparted
gparted.png
]

Can I setup my Linux Mint 19 installation to hibernate using this guide?

Thanks.
User avatar
BG405
Level 9
Level 9
Posts: 2507
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

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

Post by BG405 »

fkasmani wrote: Thu Apr 11, 2019 9:37 am Can I setup my Linux Mint 19 installation to hibernate using this guide?
As I use swap partitions on my systems, rather than a swap file, I may not know the answer to this as I don't know how swap files are handled; however, the output of your cat /etc/fstab will help determine this. It may well be useful/informative to post this anyway. :) Must do a bit of reading. I do know hibernation is possible with a swap file, however this info will show if it's an easy fix, which I suspect it may be.
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
User avatar
karlchen
Level 23
Level 23
Posts: 18211
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

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

Post by karlchen »

Hello, fkasmani.
fkasmani wrote: Thu Apr 11, 2019 9:37 amCan I setup my Linux Mint 19 installation to hibernate using this guide?
Your gparted screenshot shows that there is no swap device on your system.
This tutorial thread, however, explicitly tells "How to enable hibernation with swap partition on Linux Mint 19".
As a consequence, you cannot follow this tutorial in order to enable hibernation on your system.

But this guide might be what you need: [GUIDE] How to hibernate to a swap file in Linux Mint 19.x. Provided your system uses a swapfile.

Best regards,
Karl
Last edited by karlchen on Sat Apr 13, 2019 7:31 am, edited 1 time in total.
Reason: added link to the "[GUIDE] How to hibernate to a swap file in Linux Mint 19.x"
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
gm10

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

Post by gm10 »

BG405 wrote: Fri Apr 12, 2019 6:26 pm I don't know how swap files are handled; [...] Must do a bit of reading. I do know hibernation is possible with a swap file,
Start by reading the second sentence of the OP. 8) SCNR. ;)
User avatar
BG405
Level 9
Level 9
Posts: 2507
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 »

@gm10: Yes, somehow I missed that .. :oops: looks like fkasmani did too. Don't know what "SCNR" means? I'm often distracted, though, and have a useless short-term memory. :roll:
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
TI58C
Level 4
Level 4
Posts: 389
Joined: Tue Jul 18, 2017 5:57 am

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

Post by TI58C »

Hi all,

This may be a very "noob" question, but

I use a hp probook 6750b with mint 19.1. and have 8G swap-partition. Installed the old-fashioned way (done before reading about swap-file).

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. Back in a second.

To me this looks/feels like hibernation. But is it ? It works like this "out-of the box". Am I just lucky or am I confusing hibernate with something else (sleep?).

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

Return to “Tutorials”