You are not logged in.

#1 2021-03-18 13:42:22

obap74
Member
Registered: 2021-03-18
Posts: 74

Btrfs on LUKS: suspend and hibernate not working

Hello,

I reinstalled Arch with Btrfs on LUKS / KDE Plasma and rEFInd as bootloader a couple of days ago.
I'm having issues with suspend and hibernate aka Suspend-to-RAM and Suspend-to-disk.

A brief description of what occurs for both:

  • Suspend: when running either systemctl suspend or # echo mem > /sys/power/state, the computer goes to sleep as expected. However, after resume, I get a black screen with a static underscore at the top left corner of the screen. If I try to switch to another TTY, the underscore disappears but the screen eventually goes to deep sleep forever.

  • Hibernate: when running either systemctl hibernate or # echo disk > /sys/power/state, the computer never turns off. The screen turns blank without any error but the components are still up and running.

My hardware:

  • CPU: Intel i7-5820K

  • GPU: NVIDIA GeForce GTX 970 (with proprietary drivers installed, more details below)

  • RAM: 16GB

  • /etc/fstab:

# /dev/mapper/luks LABEL=arch
UUID=1a5ac958-ba02-4cb4-924b-730667125536	/         	btrfs     	rw,noatime,nodiratime,compress-force=zstd:1,ssd,space_cache,subvolid=256,subvol=/@	0 0

# /dev/nvme0n1p1 LABEL=EFI
UUID=0A96-86B6      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2

# /dev/mapper/luks LABEL=arch
UUID=1a5ac958-ba02-4cb4-924b-730667125536	/home     	btrfs     	rw,noatime,nodiratime,compress-force=zstd:1,ssd,space_cache,subvolid=257,subvol=/@home	0 0

# /dev/mapper/luks LABEL=arch
UUID=1a5ac958-ba02-4cb4-924b-730667125536	/var/log  	btrfs     	rw,noatime,nodiratime,compress-force=zstd:1,ssd,space_cache,subvolid=258,subvol=/@log	0 0

# /dev/mapper/luks LABEL=arch
UUID=1a5ac958-ba02-4cb4-924b-730667125536	/var/cache/pacman/pkg	btrfs     	rw,noatime,nodiratime,compress-force=zstd:1,ssd,space_cache,subvolid=259,subvol=/@pkg	0 0

# /dev/mapper/luks LABEL=arch
UUID=1a5ac958-ba02-4cb4-924b-730667125536	/.snapshots	btrfs     	rw,noatime,nodiratime,compress-force=zstd:1,ssd,space_cache,subvolid=260,subvol=/@snapshots	0 0

# /dev/mapper/luks LABEL=arch
UUID=1a5ac958-ba02-4cb4-924b-730667125536	/.swap    	btrfs     	rw,relatime,compress-force=zstd:1,ssd,space_cache,subvolid=261,subvol=/@swap	0 0

/.swap/swapfile none swap defaults 0 0
  • /etc/mkinitcpio.conf:

MODULES=(btrfs nvme)
BINARIES=()
FILES=()
HOOKS=(base udev autodetect modconf block keyboard keymap encrypt btrfs filesystems resume)
COMPRESSION="zstd"
  • $ lsblk -pfo NAME,LABEL,SIZE,TYPE,FSTYPE,MOUNTPOINT:

/dev/nvme0n1                      232,9G disk
├─/dev/nvme0n1p1         EFI        512M part  vfat        /boot
└─/dev/nvme0n1p2                  232,4G part  crypto_LUKS
  └─/dev/mapper/luks     arch     232,4G crypt btrfs       /var/log
  • # btrfs subvolume list /:

ID 256 gen 5704 top level 5 path @
ID 257 gen 5706 top level 5 path @home
ID 258 gen 5705 top level 5 path @log
ID 259 gen 5312 top level 5 path @pkg
ID 260 gen 5669 top level 5 path @snapshots
ID 261 gen 5515 top level 5 path @swap
ID 280 gen 23 top level 256 path var/lib/portables
ID 281 gen 24 top level 256 path var/lib/machines
  • $ free -hm:

              total        used        free      shared  buff/cache   available
Mem:            15Gi       4,2Gi       8,6Gi       351Mi       2,7Gi        10Gi
Swap:           15Gi          0B        15Gi
  • $ cat /proc/swaps:

Filename                                Type            Size            Used            Priority
/.swap/swapfile                         file            16777212        0               -2
  • $ swapon -s:

Filename                                Type            Size    Used    Priority
/.swap/swapfile                         file            16777212        0       -2

I created a 16GB swapfile as per Arch Wiki - Btrfs - Swap_file with:

# truncate -s 0 /.swap/swapfile
# chattr +C /.swap/swapfile
# btrfs property set /.swap/swapfile compression none
# dd if=/dev/zero of=/.swap/swapfile bs=1G count=16 status=progress
# chmod 600 /mnt/.swap/swapfile
# mkswap /mnt/.swap/swapfile

I calculated the resume_offset value as per Arch Wiki - Hibernation into swap file on Btrfs:

  • # btrfs_map_physical /.swap/swapfile | head -n 4:

FILE OFFSET     FILE SIZE       EXTENT OFFSET   EXTENT TYPE     LOGICAL SIZE    LOGICAL OFFSET  PHYSICAL SIZE   DEVID   PHYSICAL OFFSET
0       134217728       0       regular 134217728       46923313152     134217728       1       46923313152
134217728       134217728       0       regular 134217728       47057530880     134217728       1       47057530880
268435456       134217728       0       regular 134217728       47266660352     134217728       1       47266660352
  • $ getconf PAGESIZE

4096

46923313152 / 4096 = 11455887

  • /boot/EFI/refind/refind.conf:

timeout 10
hideui arrows hints
showtools about,reboot,firmware,shutdown

scanfor manual,internal
dont_scan_files + vmlinuz-linux vmlinuz-linux-lts
scan_all_linux_kernels false

extra_kernel_version_strings linux-hardened,linux-zen,linux-lts,linux

menuentry "Arch Linux" {
    icon     /EFI/refind/refind-theme-regular/icons/128-48/os_arch.png
    volume   arch
    loader   /vmlinuz-linux
    initrd   /initramfs-linux.img
    options  "cryptdevice=UUID=06f4615d-f083-4f92-902f-1ec139755408:luks root=/dev/mapper/luks rootflags=subvol=@ resume=/dev/mapper/luks resume_offset=11455887 initrd=/intel-ucode.img quiet rw"
    submenuentry "Boot fallback initramfs" {
        initrd /initramfs-linux-fallback.img
    }
}

menuentry "Arch Linux LTS" {
    icon     /EFI/refind/refind-theme-regular/icons/128-48/os_arch.png
    volume   arch
    loader   /vmlinuz-linux-lts
    initrd   /initramfs-linux-lts.img
    options  "cryptdevice=UUID=06f4615d-f083-4f92-902f-1ec139755408:luks root=/dev/mapper/luks rootflags=subvol=@ resume=/dev/mapper/luks resume_offset=11455887 initrd=/intel-ucode.img quiet rw"
    submenuentry "Boot fallback initramfs" {
        initrd /initramfs-linux-lts-fallback.img
    }
    disabled
}

include refind-theme-regular/theme.conf
include btrfs-snapshot-stanzas/arch_vmlinuz-linux.conf
include btrfs-snapshot-stanzas/arch_vmlinuz-linux-lts.conf

I tried with both:

  • linux 5.11.7-arch1-1 / linux-headers 5.11.7.arch1-1 / nvidia 460.56-7

  • linux-lts 5.10.24-1 / linux-headers-lts 5.10.24-1 / nvidia-lts 1:460.56-8

  • journalctl | rg -i sleep:

mar 18 12:17:00 archlinux systemd[1]: Reached target Sleep.
mar 18 12:17:00 archlinux systemd[1]: Starting Hibernate...
mar 18 12:17:00 archlinux systemd-sleep[3327]: Suspending system...
mar 18 12:17:00 archlinux kernel: PM: hibernation: hibernation entry
-- Boot 5b40a79c6d92465a95df97086084dde1 --

The next lines printed in journalctl are from the next reboot.

  • journalctl | rg -i hiber:

mar 18 12:17:00 archlinux systemd[1]: Starting Hibernate...
mar 18 12:17:00 archlinux kernel: PM: hibernation: hibernation entry
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x0003f000-0x0003ffff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x000a0000-0x000fffff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x31533000-0x31533fff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x31544000-0x31544fff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x31559000-0x31559fff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x3157a000-0x3157afff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x35a93000-0x35ae7fff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x38ffd000-0x39d5afff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x3a312000-0x3abb6fff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x3abb7000-0x3b5befff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x3b5c0000-0x3b645fff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x3c000000-0x3dffffff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x3e000000-0x3fffffff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x40000000-0x4fffffff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0x50000000-0xfed1bfff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0xfed1c000-0xfed44fff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0xfed45000-0xfeffffff]
mar 18 12:18:27 archlinux kernel: PM: hibernation: Registered nosave memory: [mem 0xff000000-0xffffffff]

Unfortunately, I cannot try to ping or ssh into the machine when both of these issues occur because this is the sole machine I own.


For what it's worth, I replicated my install on a virtual machine on VirtualBox and suspend and hibernate work just fine.

  • systemctl suspend: I'm getting a black screen with an underscore at the top left and the display resumes as soon as I press any key. The only difference is that it runs Suspend-To-Idle aka s2idle instead of Suspend-to-RAM aka s2idle [deep] as per Kernel.org - Documentation/power/states

  • $ cat /sys/power/mem_sleep:

s2idle [deep]  # On host machine
[s2idle]       # On VM
  • systemctl hibernate: the machine turns off and when I start it again, it asks for my LUKS password as expected and the machine is back where I left it.

Note that I also had a LVM on LUKS install (with ext4) in place of the Btrfs one only a few days ago and I didn't have this issue either, on the same hardware.

Any suggestion is much appreciated, I cannot come up with what to try next. I have Gentoo installed on the same computer but on another disk. I asked on the Gentoo Forums but I didn't get many suggestions.

Thanks in advance!

Last edited by obap74 (2021-03-20 15:31:40)

Offline

#2 2021-03-18 14:03:06

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Btrfs on LUKS: suspend and hibernate not working

obap74 wrote:

I created a 16GB swapfile as per Arch Wiki - Btrfs - Swap_file

Btrfs wiki page wrote:

The proper way to initialize a swap file is to first create a non-compressed, non-snapshotted subvolume to host the file, cd into its directory, then create a zero length file, set the No_COW attribute on it with chattr, and make sure compression is disabled

obap74 wrote:
# /dev/mapper/luks LABEL=arch
UUID=1a5ac958-ba02-4cb4-924b-730667125536	/.swap    	btrfs     	rw,relatime,compress-force=zstd:1,ssd,space_cache,subvolid=261,subvol=/@swap	0 0

Your subvolume appears to be compressed. If this is the case then it can't be read by the resume hook.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2021-03-18 14:26:05

obap74
Member
Registered: 2021-03-18
Posts: 74

Re: Btrfs on LUKS: suspend and hibernate not working

Slithery wrote:
obap74 wrote:

I created a 16GB swapfile as per Arch Wiki - Btrfs - Swap_file

Btrfs wiki page wrote:

The proper way to initialize a swap file is to first create a non-compressed, non-snapshotted subvolume to host the file, cd into its directory, then create a zero length file, set the No_COW attribute on it with chattr, and make sure compression is disabled

obap74 wrote:
# /dev/mapper/luks LABEL=arch
UUID=1a5ac958-ba02-4cb4-924b-730667125536	/.swap    	btrfs     	rw,relatime,compress-force=zstd:1,ssd,space_cache,subvolid=261,subvol=/@swap	0 0

Your subvolume appears to be compressed. If this is the case then it can't be read by the resume hook.

Why is it working fine on the VM with compress-force=zstd:1 for all subvolumes?

Anyway, I removed this part from the fstab line, which is now:

# /dev/mapper/luks LABEL=arch
UUID=1a5ac958-ba02-4cb4-924b-730667125536	/.swap    	btrfs     	rw,relatime,ssd,space_cache,subvolid=261,subvol=/@swap	0 0

However, after a reboot:

  • mount | rg -i swap:

/dev/mapper/luks on /.swap type btrfs (rw,relatime,compress-force=zstd:1,ssd,space_cache,subvolid=261,subvol=/@swap)

Not sure why compress-force=zstd:1 still listed in the options.

During the install, I created and mounted the subvolumes with the following:

btrfs su cr /mnt/@
btrfs su cr /mnt/@home
btrfs su cr /mnt/@log
btrfs su cr /mnt/@pkg
btrfs su cr /mnt/@snapshots
btrfs su cr /mnt/@swap
umount /mnt
mount -o compress-force=zstd:1,space_cache,noatime,nodiratime,ssd,subvol=@ /dev/mapper/luks /mnt
mkdir -p /mnt/{boot,home,var/log,var/cache/pacman/pkg,.snapshots,.swap}
mount -o compress-force=zstd:1,space_cache,noatime,nodiratime,ssd,subvol=@home /dev/mapper/luks /mnt/home
mount -o compress-force=zstd:1,space_cache,noatime,nodiratime,ssd,subvol=@log /dev/mapper/luks /mnt/var/log
mount -o compress-force=zstd:1,space_cache,noatime,nodiratime,ssd,subvol=@pkg /dev/mapper/luks /mnt/var/cache/pacman/pkg
mount -o compress-force=zstd:1,space_cache,noatime,nodiratime,ssd,subvol=@snapshots /dev/mapper/luks /mnt/.snapshots
mount -o nodatacow,subvol=@swap /dev/mapper/luks /mnt/.swap

Last edited by obap74 (2021-09-18 14:01:18)

Offline

#4 2021-03-18 15:03:37

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: Btrfs on LUKS: suspend and hibernate not working

obap74 wrote:

Anyway, I removed this part from the fstab line, which is now:

[...]

Not sure why compress-force=zstd:1 still listed in the options.

[...]

The compress mount option comes back because there's actually only one set of mount options for the whole filesystem. It's not possible to use different mount options for just one subvolume.

The mount options for the first subvolume in your fstab are the only ones that matter. The rest of your subvolumes will inherit those mount options.

If you want to disable CoW and compression and checksums, you have to use the "chattr +C" command on a directory or subvolume. Newly created files and sub-folders will then inherit that attribute. You can check on things with the "lsattr" command.

Last edited by Ropid (2021-03-18 15:06:50)

Offline

#5 2021-03-18 15:49:59

obap74
Member
Registered: 2021-03-18
Posts: 74

Re: Btrfs on LUKS: suspend and hibernate not working

Ropid wrote:

The compress mount option comes back because there's actually only one set of mount options for the whole filesystem. It's not possible to use different mount options for just one subvolume.

The mount options for the first subvolume in your fstab are the only ones that matter. The rest of your subvolumes will inherit those mount options.

If you want to disable CoW and compression and checksums, you have to use the "chattr +C" command on a directory or subvolume. Newly created files and sub-folders will then inherit that attribute. You can check on things with the "lsattr" command.

Thanks for the explanation. I removed compress-force=zstd:1 option for all subvolumes and rebooted:

  • mount | rg "/dev/mapper/luks":

/dev/mapper/luks on / type btrfs (rw,noatime,nodiratime,ssd,space_cache,subvolid=256,subvol=/@)
/dev/mapper/luks on /.snapshots type btrfs (rw,noatime,nodiratime,ssd,space_cache,subvolid=260,subvol=/@snapshots)
/dev/mapper/luks on /.swap type btrfs (rw,relatime,ssd,space_cache,subvolid=261,subvol=/@swap)
/dev/mapper/luks on /home type btrfs (rw,noatime,nodiratime,ssd,space_cache,subvolid=257,subvol=/@home)
/dev/mapper/luks on /var/cache/pacman/pkg type btrfs (rw,noatime,nodiratime,ssd,space_cache,subvolid=259,subvol=/@pkg)
/dev/mapper/luks on /var/log type btrfs (rw,noatime,nodiratime,ssd,space_cache,subvolid=258,subvol=/@log)

I deleted the old swapfile and recreated it again, then ran

  • # lsattr /.swap:

---------------C-----m /.swap/swapfile

After a reboot, the issue persists, both for suspend and hibernate.

Do I have to delete the swap subvolume and recreate it?

I still don't understand why it works on the VM with compress-force=zstd:1. Not to mention that unless I'm mistaken, I don't need swap for a simple suspend-to-RAM.

Offline

#6 2021-03-18 18:42:48

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: Btrfs on LUKS: suspend and hibernate not working

You don't have to remove the compress mount option because the "chattr +C" is disabling CoW+compression+checksums. You can keep the mount option so that you have compression in your normal subvolumes.

I don't know what's going wrong but it shouldn't be anything about your swap file. You have that "C" in the lsattr output and that means the file is okay. You also used that btrfs_map_physical program so the resume_offset number should be good.

Your problem has to be somewhere else. I remembered seeing something about suspending in Nvidia's documentation. I found this chapter here online with Google right now:

http://download.nvidia.com/XFree86/Linu … ement.html

That chapter of the documentation mentions something about systemd services. I think you don't have to follow the instructions there exactly, you don't have to do the "sudo install ..." stuff. I looked into the file listing of the nvidia-utils package and the service files are already prepared by the Arch package and in the correct place:

$ pacman -Fl nvidia-utils | grep service
nvidia-utils usr/lib/systemd/system/nvidia-hibernate.service
nvidia-utils usr/lib/systemd/system/nvidia-persistenced.service
nvidia-utils usr/lib/systemd/system/nvidia-resume.service
nvidia-utils usr/lib/systemd/system/nvidia-suspend.service

I think you just have to enable them with systemctl.

Then afterwards, I'm not sure I understood what the Nvidia documentation is talking about but I'm guessing manually doing things like "echo mem > /sys/power/state" is not allowed. You have to go through systemctl so that the Nvidia services get run correctly.

You can also find the Nvidia documentation locally installed in this location:

/usr/share/doc/nvidia/

There's an index.html file that you can open in your web browser.

About the PC not shutting off when you hibernate, I remember a problem I had here with a computer where the default "platform" setting for HibernateMode in /etc/systemd/sleep.conf didn't work, I had to change it to "shutdown".

Last edited by Ropid (2021-03-18 18:48:52)

Offline

#7 2021-03-18 20:27:55

obap74
Member
Registered: 2021-03-18
Posts: 74

Re: Btrfs on LUKS: suspend and hibernate not working

Ropid wrote:

Your problem has to be somewhere else. I remembered seeing something about suspending in Nvidia's documentation. I found this chapter here online with Google right now:

http://download.nvidia.com/XFree86/Linu … ement.html

That chapter of the documentation mentions something about systemd services. I think you don't have to follow the instructions there exactly, you don't have to do the "sudo install ..." stuff. I looked into the file listing of the nvidia-utils package and the service files are already prepared by the Arch package and in the correct place:

$ pacman -Fl nvidia-utils | grep service
nvidia-utils usr/lib/systemd/system/nvidia-hibernate.service
nvidia-utils usr/lib/systemd/system/nvidia-persistenced.service
nvidia-utils usr/lib/systemd/system/nvidia-resume.service
nvidia-utils usr/lib/systemd/system/nvidia-suspend.service

I think you just have to enable them with systemctl.

Then afterwards, I'm not sure I understood what the Nvidia documentation is talking about but I'm guessing manually doing things like "echo mem > /sys/power/state" is not allowed. You have to go through systemctl so that the Nvidia services get run correctly.

You can also find the Nvidia documentation locally installed in this location:

/usr/share/doc/nvidia/

There's an index.html file that you can open in your web browser.

Yes, I forgot to mention it here but as I wrote on my post in the Gentoo Forums, I already tried enabling these services, to no avail. I've been running Arch for about 4 years and I never had to enable them in order to get suspend and hibernate working by the way.

Ropid wrote:

About the PC not shutting off when you hibernate, I remember a problem I had here with a computer where the default "platform" setting for HibernateMode in /etc/systemd/sleep.conf didn't work, I had to change it to "shutdown".

I've just tried this and rebooted but it doesn't make any difference unfortunately.

Ropid wrote:

I don't know what's going wrong but it shouldn't be anything about your swap file. You have that "C" in the lsattr output and that means the file is okay. You also used that btrfs_map_physical program so the resume_offset number should be good.

Indeed, I don't think it's an issue with the swapfile or the resume_offset value. I don't think there's anything wrong with using compress-force=zstd:1 either since everything works like a charm on the VM installed with the same steps. It doesn't explain why the machine doesn't resume properly with suspend-to-RAM, since swap isn't involved at all in that case.

I'll wait for some more suggestions. I know it's a bit overkill but I might end up reinstalling at some point. Maybe starting with a minimum install would be easier to find the culprit. I could do some extensive testing with suspend/hibernate between every few packages installation for instance. I have Snapper set up so I could take advantages of snapshots to do so.

Thank you guys for your help, I hope I'll find the culprit soon.

Last edited by obap74 (2021-03-18 20:32:17)

Offline

#8 2021-03-20 11:15:51

obap74
Member
Registered: 2021-03-18
Posts: 74

Re: Btrfs on LUKS: suspend and hibernate not working

After two reinstalls and many suspend/hibernate tests, the issue seems to be fixed.

First reinstall:

After a base install with:

pacstrap /mnt base base-devel bc btrfs-progs efibootmgr git intel-ucode linux linux-firmware linux-headers  neovim networkmanager refind zsh

and a shutdown, all good.

  • After installing KDE Plasma + xorg and a shutdown, all good.

  • After installing nvidia package and a shutdown, all good.

  • After installing my extra packages and a shutdown, all good.

  • After installing my AUR packages and a shutdown, all good.

After doing some post-install stuff, all good until I copied all my custom systemd services/timers to /etc/systemd/system, enabled the services with sudo systemctl enable service_name.service and turned off/restarted the computer.

At this point, the issue came back both for suspend and hibernate.

I tried disabling the service units one by one with shutdown and suspend/hibernate attempts in between, no dice.

I gave up and reinstalled again. I did the exact same tests, except this time I skipped the activation of my custom systemd services during the post-install part.

I copied and enabled them one by one with a shutdown and suspend/hibernate attempts in between. All good.

I suspended and hibernated the system maybe 10 or 15 times since then after a few reboots/shutdown and both work consistently, at least for now.

Note that I'm still using compress-force=zstd:1.


Marking this as solved, although I have no idea what the culprit was.

Now I'm going to try to solve the issue on my Gentoo install without reinstalling...

Last edited by obap74 (2021-03-20 15:43:44)

Offline

#9 2021-03-20 15:43:15

obap74
Member
Registered: 2021-03-18
Posts: 74

Re: Btrfs on LUKS: suspend and hibernate not working

Annnd, of course, a few hours after I marked this as solved, the issue has just occurred again.

I successfully resumed from suspend this morning and didn't do anything special on the computer. The only pacman operation of today:

[ALPM] upgraded kiconthemes (5.80.0-1 -> 5.80.0-2)

I tried to suspend again and upon resume: black screen with static underscore at the top left of the screen.

  • journalctl | rg -i suspend:

mar 20 00:33:00 archlinux systemd[1]: Starting Suspend...
mar 20 00:33:00 archlinux systemd-sleep[131405]: Suspending system...
mar 20 00:33:00 archlinux kernel: PM: suspend entry (deep)
mar 20 09:44:00 archlinux kernel: printk: Suspending console(s) (use no_console_suspend to debug)
mar 20 09:44:00 archlinux kernel: PM: suspend exit
mar 20 09:44:00 archlinux systemd[1]: systemd-suspend.service: Deactivated successfully.
mar 20 09:44:00 archlinux systemd[1]: Finished Suspend.
mar 20 09:44:00 archlinux audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-suspend comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
mar 20 09:44:00 archlinux audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-suspend comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
mar 20 09:44:00 archlinux systemd[1]: Reached target Suspend.
mar 20 09:44:00 archlinux kernel: audit: type=1130 audit(1616229840.403:939): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-suspend comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
mar 20 09:44:00 archlinux kernel: audit: type=1131 audit(1616229840.403:940): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-suspend comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
mar 20 09:44:00 archlinux systemd[1]: Stopped target Suspend.
mar 20 09:44:04 archlinux kded5[1685]: plasma-nm: Not emitting connection deactivated notification as we're about to suspend
mar 20 09:44:06 archlinux kded5[1685]: plasma-nm: Not emitting connection activated notification as the connection was active prior to suspend
mar 20 10:07:52 archlinux kded5[1698]: kscreen.kded: PowerDevil SuspendSession action not available!
mar 20 16:16:54 archlinux kded5[1700]: plasma-nm: Not emitting connection deactivated notification as we're about to suspend
mar 20 16:16:55 archlinux systemd[1]: Starting Suspend...
mar 20 16:16:55 archlinux systemd-sleep[245739]: Suspending system...
mar 20 16:16:55 archlinux kernel: PM: suspend entry (deep)
mar 20 16:18:59 archlinux kded5[1855]: kscreen.kded: PowerDevil SuspendSession action not available!
mar 20 16:27:23 archlinux systemd[1]: Starting Suspend...
mar 20 16:29:13 archlinux kded5[1836]: kscreen.kded: PowerDevil SuspendSession action not available!

I suspended the computer at 00:33:00 and resumed sucessfully this morning at 09:44. The next failed attempt was at 16:16:54.

Any suggestion on how to understand what's going on?

Thanks.

Edit: Rebooting/turning off the computer doesn't help, it fails everytime just like before.

Last edited by obap74 (2021-03-20 16:12:10)

Offline

#10 2021-03-24 11:13:33

obap74
Member
Registered: 2021-03-18
Posts: 74

Re: Btrfs on LUKS: suspend and hibernate not working

I reinstalled again and went with bspwm this time around. Suspend/hibernate worked fine for two days until this morning.

I resumed successfully, browsed the Internet for half an hour and installed file-roller. After a reboot and another attempt to suspend/resume, the issue is back.

Reverting to an older snapshot (when suspend/hibernate used to work just fine) from a live ISO with the following solves the issue:

# cryptsetup luksOpen /dev/nvme0n1p2 luks
# mount /dev/mapper/luks /mnt
# rm -rf /mnt/@
# btrfs subvolume snapshot /mnt/@snapshots/*/snapshot /mnt/@     (where * is the snapshot number)

I'm really clueless as to what the culprit could be.

I know for sure it's neither:

  • My Btrfs subvolumes layout/mount options

  • Xorg/NVIDIA drivers

  • KDE Plasma, considering it also happens with bspwm

  • My post-install modifications, considering suspend/hibernate work just fine with all of them in place (up to a certain point).

I wish I could get some useful information from logs but it seems that the machine freezes completely since there's nothing in journalctl between the suspend/hibernate and the next reboot.

Offline

#11 2021-04-02 13:53:39

obap74
Member
Registered: 2021-03-18
Posts: 74

Re: Btrfs on LUKS: suspend and hibernate not working

Anyone?

I did a clean install with LVM on LUKS, no issue whatsoever with suspend/hibernate in the last 8 days.

Offline

Board footer

Powered by FluxBB