I am trying to get hibernation to work in Arch Linux. I am using a swap file in BTRFS, which is under a separate subvolume from /
(both are under subvolume ID 5 A.K.A top-level). I am also using disk encryption with dm-crypt.
I have:
- Added the
resume
hook afterkeyboard
but beforefsck
. - Added the resume kernel parameter as follows:
resume=UUID=*UUID of mapped LUKS device*
- Added the resume offset as follows:
resume_offset=*offset*
I have tried the following methods to get the resume offset:
- Filefrag:
filefrag -v *swap path* | awk '{ if($1=="0:"){print $4} }'
, from the ArchWiki - A script: btrfs_map_physical.c, from this StackExchange answer (I also tried the other hibernation method instead of systemd)
When I execute systemctl hibernate
the monitor turns off but then immediately turns back on. Since I am not using the quiet
kernel parameter, this message is printed in the TTY:
[7695.071873] tpm tpm0: tpm_try_transmit: send(): error -5
[7695.770207] PM: Cannot find swap device, try swapon -a
[7695.770223] PM: Cannot get swap writer
Similar messages come when using the alternate method.