nailfarmer / debian-luks-suspend

Lock encrypted root volume on suspend in Debian
14 stars 4 forks source link

Suspend hangs up in `echo mem > /sys/power/state` stage #9

Open Yannik opened 4 years ago

Yannik commented 4 years ago

Thank you for this project, I really appreciate it. I am using this (with some alterations due to a different initramfs setup) on fedora.

About 2/3 of the time, everything works fine, but sometimes, the suspend hangs at the echo mem > /sys/power/state command. I've had this issue for quite some time, thinking it would possibly get resolved by the new sync_on_suspend feature in kernel 5.6. Unfortunately, this did not fix it.

Can you give me some tips on how to debug this and find out what is causing the hang?

nailfarmer commented 4 years ago

Hi Yannik,

I'm thrilled that you're working on getting this functional on fedora!

The first thing I'd recommend doing is checking out the hangs-wip branch, I have added a couple of additional tricks that I use to reduce hangs.

In particular, I've used rtcwake to introduced a one-second normal suspend-resume cycle before attempting to lock the crypt volume. I also make sure to stop networking, bluetooth, and journald to reduce potential io. Before doing any further debugging, you may want to try this to see if it resolves your hangs.

Debugging is not easy, but the first thing I'd recommend is allowing console messages on the kernel command line by removing the 'quiet' option if you have it, and changing the console loglevel to 7. There's some additional advice here about how to debug suspend and resume in general, but not specific to dealing with cryptsetup.

For general information on the suspend-resume process, this guide is helpful reading, if you haven't seen it before.

Yannik commented 4 years ago

Thank you, that will certainly be helpful!

Maryse47 commented 4 years ago

@Yannik hang may be related to lack of firmware in chroot env: https://salsa.debian.org/mejo/cryptsetup-suspend/-/issues/38#note_146745