You are not logged in.

#1 2020-01-25 22:55:03

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

Using the latest kernel 5.4.14 my hibernate doesn't work anymore.

$ systemctl hibernate
Failed to hibernate system via logind: Not enough swap space for hibernation

even though I definitely have enough swap space available:

$ swapon
NAME           TYPE      SIZE USED PRIO
/dev/nvme0n1p7 partition   8G   0B   -2

$ free -h
              total        used        free      shared  buff/cache   available
Mem:          7.5Gi       1.0Gi       5.8Gi       245Mi       745Mi       6.0Gi
Swap:         8.0Gi          0B       8.0Gi

If I boot to linux-lts 4.19.98-1 without changing anything else, everything works perfectly.
I don't know when exactly this broke, but a few weeks back everything worked as well.

Offline

#2 2020-01-25 23:25:09

bidetaggle
Member
Registered: 2018-12-22
Posts: 12

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

Im3rik wrote:

If I boot to linux-lts 4.19.98-1 without changing anything else, everything works perfectly.
I don't know when exactly this broke, but a few weeks back everything worked as well.

What kernel do you use when you're not booting on this one? It looks like it comes from a kernel update then.

Offline

#3 2020-01-25 23:31:36

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

Im3rik wrote:

Using the latest kernel 5.4.14

I just updated to this one from 5.4.13 hoping it would fix my issue. So it's definitely not working with these two.
I guess it must have been an update about 1-2 months ago.

Offline

#4 2020-02-15 23:00:46

hills_of_eternity
Member
From: Moscow
Registered: 2017-04-28
Posts: 22
Website

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

Im3rik wrote:
Im3rik wrote:

Using the latest kernel 5.4.14

I just updated to this one from 5.4.13 hoping it would fix my issue. So it's definitely not working with these two.
I guess it must have been an update about 1-2 months ago.

Did you fix it? I've ran into this issue too few month ago.

Offline

#5 2020-02-15 23:53:19

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

Unfortunately no. I'm still hoping for some kernel update to fix it eventually.

Offline

#6 2020-02-17 00:08:46

hills_of_eternity
Member
From: Moscow
Registered: 2017-04-28
Posts: 22
Website

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

Im3rik wrote:

Unfortunately no. I'm still hoping for some kernel update to fix it eventually.

Hi, i'm going to tell you what I've found.
Actually it is not a kernel issue but systemd issue (at least looks like). I've tried to downgrade both linux and systemd pakages and realized that only systemd downgrade is helpful. I've pinned
systemd-243.162-2-x86_64.pkg.tar.xz this one but you can look for newer version that also works.

Last edited by hills_of_eternity (2020-02-17 00:09:11)

Offline

#7 2020-02-17 00:13:53

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

Thanks for sharing your research.
Why does it work with the current linux-lts kernel without switching systemd version though?
Or do I miss something? Does the lts kernel use another systemd version?

Offline

#8 2020-02-17 22:17:37

hills_of_eternity
Member
From: Moscow
Registered: 2017-04-28
Posts: 22
Website

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

Im3rik wrote:

Thanks for sharing your research.
Why does it work with the current linux-lts kernel without switching systemd version though?
Or do I miss something? Does the lts kernel use another systemd version?

hmmm... for me it doesn't. I've tried to downgrade and switching to lts/ck/fsync kernels at first.
And then i downgraded systemd.

Current kernel hibernates well.

[ab@pussy ~]$ uname -a
Linux pussy 5.5.3-arch1-1 #1 SMP PREEMPT Tue, 11 Feb 2020 15:35:41 +0000 x86_64 GNU/Linux
[ab@pussy ~]$ yay -Q systemd
systemd 243.162-1

Offline

#9 2020-02-17 22:31:27

loqs
Member
Registered: 2014-03-06
Posts: 18,928

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

If you boot with the option systemd.log_level=debug more output should be produced relating to the failure to hibernate.

Offline

#10 2020-02-17 23:28:30

hills_of_eternity
Member
From: Moscow
Registered: 2017-04-28
Posts: 22
Website

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

loqs wrote:

If you boot with the option systemd.log_level=debug more output should be produced relating to the failure to hibernate.

Thank you, I've found in logs something like

systemd-logind[628]: Failed to open /home/swapfile: No such file or directory

I have to store swap in /home due to fast SSD, so i made override for systemd-logind.service like this

[Service]
ProtectHome=No

And issue has gone.

Last edited by hills_of_eternity (2020-02-17 23:44:28)

Offline

#11 2020-04-08 17:47:06

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

I still have this problem with kernel 5.6.2 and systemd 245.4-2.

loqs wrote:

If you boot with the option systemd.log_level=debug more output should be produced relating to the failure to hibernate.

I got these two messages after enabling the kernel option:

systemd-logind[480]: /dev/nvme0n1p7: is a candidate device.
systemd-logind[480]: No swap partitions or files matching resume config were found in /proc/swaps.

/dev/nvme0n1p7 is my swap partition and /proc/swaps looks like this:

Filename				Type		Size	Used	Priority
/dev/nvme0n1p7                          partition	8388604	0	-2

Offline

#12 2020-04-08 18:20:32

loqs
Member
Registered: 2014-03-06
Posts: 18,928

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

@lm3rik what is the output of

cat /proc/cmdline

Offline

#13 2020-04-08 18:33:01

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

My kernel parameters are

root=UUID=510cadba-092a-44f0-8782-53ea82fdebc7 resume=UUID=510cadba-092a-44f0-8782-53ea82fdebc7 rw systemd.log_level=debug quiet random.trust_cpu=on initrd=\initramfs-linux.img

Offline

#14 2020-04-08 18:40:57

loqs
Member
Registered: 2014-03-06
Posts: 18,928

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

What is the output of

# blkid

Offline

#15 2020-04-08 18:45:31

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

It's

/dev/nvme0n1p1: LABEL="Wiederherstellung" BLOCK_SIZE="512" UUID="1C1A24D31A24AC28" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="cc85e047-8005-4cbb-9ff5-0707f173fac5"
/dev/nvme0n1p2: UUID="9488-0019" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="4336566d-80ac-46b5-9730-6d9e531f0b81"
/dev/nvme0n1p4: BLOCK_SIZE="512" UUID="B40E81530E811012" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="b6d52612-fda0-457e-82cd-2474a935e78d"
/dev/nvme0n1p5: UUID="2ebae96a-9d92-4095-8299-068beacab285" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Arch home" PARTUUID="08488340-21ed-48b1-922f-638567442972"
/dev/nvme0n1p6: UUID="510cadba-092a-44f0-8782-53ea82fdebc7" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Arch root" PARTUUID="df0e376f-b396-41d1-8624-e80eaad6373d"
/dev/nvme0n1p7: UUID="4a8af29b-38f9-4e55-a46b-3357f314bae8" TYPE="swap" PARTLABEL="Swap" PARTUUID="b21cf04e-fcde-4db0-b7a0-276d8d6cc634"
/dev/nvme0n1p3: PARTLABEL="Microsoft reserved partition" PARTUUID="19d23710-90bc-4c65-8a84-177a4ecd7c35"

Offline

#16 2020-04-08 18:47:57

loqs
Member
Registered: 2014-03-06
Posts: 18,928

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

root=UUID=510cadba-092a-44f0-8782-53ea82fdebc7 resume=UUID=510cadba-092a-44f0-8782-53ea82fdebc7

Specifies the resume partition is the same as the root partition.

/dev/nvme0n1p6: UUID="510cadba-092a-44f0-8782-53ea82fdebc7" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Arch root" PARTUUID="df0e376f-b396-41d1-8624-e80eaad6373d"

not

/dev/nvme0n1p7: UUID="4a8af29b-38f9-4e55-a46b-3357f314bae8" TYPE="swap" PARTLABEL="Swap" PARTUUID="b21cf04e-fcde-4db0-b7a0-276d8d6cc634"

Offline

#17 2020-04-08 19:00:05

Im3rik
Member
Registered: 2019-11-09
Posts: 31

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

Oh wow, you're right. Now it works just fine.
That also explains why hibernation worked using the lts kernel. I used another boot entry for the lts kernel and I didn't specify a resume partition.

However how could this work a few months ago? I'm pretty sure I haven't changed the boot entry since then.

Thank you very much for your help.

Offline

#18 2020-04-08 19:11:29

loqs
Member
Registered: 2014-03-06
Posts: 18,928

Re: Kernel 5.4.14 broke hibernate: Not enough swap space for hibernation

Additional checks were introduced in systemd 244.

Offline

Board footer

Powered by FluxBB