1) I am using systemd to suspend to disk using: systemctl hibernate

2) I have mounted a filesystem on an encrypted block device, that I suspend using dmsetup suspend device in order to wipe the key before I go into hibernation.

The problem:

The hibernation hangs at

systemd-sleep[7366]: Suspending system...
kernel: PM: Hibernation mode set to 'platform'
kernel: PM: Syncing filesystems ...

If I resume (dmsetup resume device), then the syncing can be completed and hibernation will continue

Is there another way to either issue the suspend command AFTER the sync when entering hibernation? Or another way to wipe the encryption keys, that allows me to safely enter hibernation (besides encryption the swap partition)?

1 Answer 1


one solution seems to be to use the following systemd unit:




<target> is the corresponding target of your desired mode. From the systemd-suspend.service Manpage: suspend.target, hibernate.target, or hybrid-sleep.target

And the wipe script:

dmsetup suspend "$name"
dmsetup message "$name" 0 key wipe

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.