Can't hibernate, even with swap configured correctly (partition, fstab, mkinitcpio.conf, grub resume=UUID=)

Hmmm running on an SSD I’m happy I opted for no partition, I use swapfile - so hibernate works.

Hmmm. I might be lost here, but isn’t the resume_offset only needed when using a swap file? And you are using a dedicated partition supposedly.

To be honest I don’t know what this resume_offset is! I’ll try to remove it and see what happens

MMhhh okay I removed the resume_offset, and ran sudo update-grub, then rebooted.

Now systemctl hibernate turns the computer off, but it boots in a new session instead of finding previous state. So basically now it turns off instead of hibernating.

1 Like

Hi Lenatan

Maybe this following can help you … maybe not, but you can read that…

when you create manually partitions on ssd, swapfiles is created but not mounted !
See throught “gparted” if it’s the case.
If yes, you could solve the problem by ordering permanent activation of the SWAPfiles by console commands as follows :
From Wiki swap of NGr - to do the fat commands(past) :wink: :

a/ we need to enable the swap partition with the swapon command.
sudo swapon /dev/sda3 (Be sure that sda3 is the good swap-partition, before launch the command “swapon”)

b/ In order to ensure that the swap is enabled at boot we can add an entry to /etc/fstab .
It is best to use the UUID instead of the device name for this purpose. You can add the line to fstab manually or using the command:

sudo bash -c "echo UUID=$(lsblk -no UUID /dev/sda3) none swap defaults 0 0 >> /etc/fstab"

And that run well !..after restarting of course.
Best Regards
Philline00 - Newbie forever.

What are the outputs of:

cat /sys/power/state
cat /sys/power/disk

Also, at this point, knowing your actual concrete hardware configuration might be of great help.

Uh thanks for the reply but if you read my original post carefully you would find that I’ve done all this already :wink:

$ inxi -Fazy
System:
  Kernel: 5.4.85-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.4-x86_64 
  root=UUID=c9136c9f-47f5-4078-8d4c-af348b4a9581 rw quiet udev.log_priority=3 
  threadirqs resume=UUID=87f8312e-ee14-4593-ad90-181ad341426e 
  resume=/dev/disk/by-uuid/87f8312e-ee14-4593-ad90-181ad341426e 
  Desktop: KDE Plasma 5.20.4 tk: Qt 5.15.2 wm: kwin_x11 dm: SDDM 
  Distro: Manjaro Linux 
Machine:
  Type: Laptop System: LENOVO product: 24295F3 v: ThinkPad T530 
  serial: <filter> Chassis: type: 10 serial: <filter> 
  Mobo: LENOVO model: 24295F3 serial: <filter> UEFI [Legacy]: LENOVO 
  v: G4ET93WW (2.53 ) date: 02/22/2013 
Battery:
  ID-1: BAT0 charge: 24.7 Wh condition: 73.9/86.6 Wh (85%) volts: 11.0/11.1 
  model: LGC 45N1011 type: Li-ion serial: <filter> status: Discharging 
CPU:
  Info: Quad Core model: Intel Core i7-3840QM bits: 64 type: MT MCP 
  arch: Ivy Bridge family: 6 model-id: 3A (58) stepping: 9 microcode: 21 
  L2 cache: 8 MiB 
  flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 44712 
  Speed: 1197 MHz min/max: 1200/3800 MHz Core speeds (MHz): 1: 1197 2: 1197 
  3: 1197 4: 1205 5: 1197 6: 1216 7: 1197 8: 1222 
  Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds status: Vulnerable: No microcode 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: Intel 3rd Gen Core processor Graphics vendor: Lenovo driver: i915 
  v: kernel bus ID: 00:02.0 chip ID: 8086:0166 
  Device-2: Acer ThinkPad Integrated Camera type: USB driver: uvcvideo 
  bus ID: 1-1.6:6 chip ID: 5986:02d2 
  Display: x11 server: X.Org 1.20.10 compositor: kwin_x11 driver: intel 
  unloaded: modesetting alternate: fbdev,vesa display ID: :0 screens: 1 
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") 
  s-diag: 582mm (22.9") 
  Monitor-1: LVDS1 res: 1920x1080 hz: 60 dpi: 143 size: 340x190mm (13.4x7.5") 
  diag: 389mm (15.3") 
  OpenGL: renderer: Mesa DRI Intel HD Graphics 4000 (IVB GT2) 
  v: 4.2 Mesa 20.3.1 compat-v: 3.0 direct render: Yes 
Audio:
  Device-1: Intel 7 Series/C216 Family High Definition Audio vendor: Lenovo 
  driver: snd_hda_intel v: kernel bus ID: 00:1b.0 chip ID: 8086:1e20 
  Sound Server: ALSA v: k5.4.85-1-MANJARO 
Network:
  Device-1: Intel 82579LM Gigabit Network vendor: Lenovo driver: e1000e 
  v: 3.2.6-k port: 5080 bus ID: 00:19.0 chip ID: 8086:1502 
  IF: enp0s25 state: down mac: <filter> 
  Device-2: Intel Centrino Advanced-N 6205 [Taylor Peak] driver: iwlwifi 
  v: kernel port: efa0 bus ID: 03:00.0 chip ID: 8086:0085 
  IF: wlp3s0 state: up mac: <filter> 
  Device-3: Ericsson Business Mobile Networks BV H5321 gw Mobile Broadband 
  Module 
  type: USB driver: cdc_acm,cdc_mbim,cdc_wdm bus ID: 2-4:6 chip ID: 0bdb:1926 
  serial: <filter> 
  IF: wwp0s20u4i6 state: down mac: <filter> 
Drives:
  Local Storage: total: 489.05 GiB used: 133.36 GiB (27.3%) 
  SMART Message: Unable to run smartctl. Root privileges required. 
  ID-1: /dev/sda maj-min: 8:0 vendor: Crucial model: CT525MX300SSD1 
  size: 489.05 GiB block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s 
  serial: <filter> rev: R060 
Partition:
  ID-1: / raw size: 100 GiB size: 97.93 GiB (97.93%) used: 15.93 GiB (16.3%) 
  fs: ext4 dev: /dev/sda5 maj-min: 8:5 
  ID-2: /home raw size: 300 GiB size: 294.29 GiB (98.10%) 
  used: 117.43 GiB (39.9%) fs: ext4 dev: /dev/sda6 maj-min: 8:6 
Swap:
  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
  ID-1: swap-1 type: partition size: 20 GiB used: 0 KiB (0.0%) priority: -2 
  dev: /dev/sda2 maj-min: 8:2 
Sensors:
  System Temperatures: cpu: 51.0 C mobo: 0.0 C 
  Fan Speeds (RPM): cpu: 1981 
Info:
  Processes: 247 Uptime: 20h 58m wakeups: 19 Memory: 15.35 GiB 
  used: 2.19 GiB (14.2%) Init: systemd v: 247 Compilers: gcc: 10.2.0 Packages: 
  pacman: 1444 lib: 476 Shell: Bash v: 5.1.0 running in: konsole inxi: 3.2.01

$ cat /sys/power/state
freeze mem disk

$ cat /sys/power/disk
[platform] shutdown reboot suspend test_resume 

I hope this helps!

Hi,
apparently, your /etc/fstab currently still looks like that:

UUID=c9136c9f-47f5-4078-8d4c-af348b4a9581 / ext4 defaults,noatime 0 1
UUID=5af7b8e0-2ec8-46ff-b69e-4b706289268d /home ext4 defaults,noatime 0 2
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
UUID=87f8312e-ee14-4593-ad90-181ad341426e none swap 0 0

The entry defining the swap partition is missing the “defaults” parameter.
It should look like this:

UUID=87f8312e-ee14-4593-ad90-181ad341426e none swap defaults 0 0

@Philline00 hinted at this in his previous post

Woops, it seems I owe @Philline00 some excuses! In the end I’m the one not reading carefully… sorry.

EDIT: adding default to my fstab didn’t work though, it stills reboot as if I had hit ‘shutdown’ instead of ‘hibernate’

EDIT2: would it change something if in fstab the line about the swap partition were to be the first line instead of the last?

I’d check with:
swapon -s
and with
free
whether the swap space is now in use as it should be.

no

I’m not on Manjaro, so I don’t know whether that tmpfs line in /etc/fstab is standard.
I don’t have it.
But that shouldn’t affect anything re hibernation - it’s just something I noticed when comparing with my configuration.

I don’t think you should have the resume parameter twice, even if it is with different naming convention… :roll_eyes:

Also, did you tried by chance with another kernel more recent, like 5.10?

You could even remove the swap entry in fstab if the disk it’s partitioned like GPT, BTW.

been the swap partition previously formatted with swapfile profile through Gparted ?

… as an addition to my previous post - and after you have checked that the swap indeed works:
if suspending still doesn’t want to work I’d try to alter the
/etc/mkinitcpio.conf
such that the “resume” hook will not be at the third position
but at the very last.

The order of those things is sometimes important.
Though the Arch wiki says that the hook must come after the “udev” hook - and it is in your case, their example has it as the second to last.
https://wiki.archlinux.org/index.php/Power_management/Suspend_and_hibernate#Configure_the_initramfs

In my file it is the very last hook.
… just try to move it to the end, regenerate the initramfs, see if that really makes a difference
Other than that I have no more bright ideas. :man_shrugging:

I think because I tried ‘hibernator’ script, it got me that second resume parameter. I removed it.

I tried moving the ‘resume’ hook to the very last position, ran sudo mkinitcpio, but doesn’t work. I’ll try the swap file and see if that works… getting tired of trying stuff.

Thank you all for your help!

EDIT: I followed How to Create and Use Swap File on Linux instructions and created a swapfile. But guess what? It doesn’t work either. F*********

Again without a preset this will only perform a dry run. Use the -P flag!!

1 Like

Still waiting for those two commands output…

Anyway, if you are still in the mood for trying other things:
https://wiki.archlinux.org/index.php/Uswsusp

Oh my, I didn’t realise you said that in the first place… and now IT WORKS! Muahaha thanks so much :slight_smile:

@Signalrunner sorry, I thought you had seen them, I admit they were a bit hidden!

1 Like

I would suggest that you use the Arch wiki in favor of these other sources of info on how to do stuff.
Manjaro is derived from Arch and almost all things are exactly the same and well documented in that wiki.

If you now use a swap file you’ll then need the “resume_offset” parameter again!

Further I’d suggest to install at least one other kernel - just to be safe and to be able to test whether this problem is kernel related - it’s probably not, though.

edit:
I just saw that you got it working now.
Good on you!

1 Like