I need help mounting encrypted swap with systemd during boot time. The situation is as follows:
I have a Debian 9 system, in Crunchbang++ flavour. During installation, I set up swap as an encrypted partition sitting over a LVM volume.
I expected to be prompted for the passphrase during boot, where I would type in the correct one and voila! I have a mounted swap.
Except the prompt never showed up. There's instead a systemd message saying "crypt_init() failed: Block device required".
I dug around a bit, found the generated service unit file in /var/run/systemd/generator, tried the command in
ExecStart, and it asked me for the passphrase and mounted alright. At this point I'm in a running system with everything except swap mounted and shell access.
So I suspect there is something wrong in the order of mounting and the opening encrypted partition. However, I'm quite an amateur in Linux and more so in systemd. This is all I can gather for now. If there's anything I've missed, please point that out, I'd be immensely thankful for that.
Nov 23 14:27:09 cbpp systemd: Starting Cryptography Setup for cbpp-swap_crypt... Nov 23 14:27:09 cbpp systemd-cryptsetup: crypt_init() failed: Block device required Nov 23 14:27:09 cbpp systemd: systemd-cryptsetup@cbpp\x2dswap_crypt.service: Main process exited, code=exited, status=1/FAILURE Nov 23 14:27:09 cbpp systemd: Failed to start Cryptography Setup for cbpp-swap_crypt.
cbpp-swap_crypt UUID=da050680-aa68-4e5b-bd89-aa9eb719dfae none luks
/dev/mapper/cbpp-swap_crypt none swap sw 0 0
lsblk -o +UUID when the swap is mounted:
|─cbpp-swap 254:2 0 7.5G 0 lvm da050680-aa68-4e5b-bd89-aa9eb719dfae │ └─cbpp-swap_crypt 254:8 0 7.5G 0 crypt a917edd3-863f-4619-9006-9036acf5e075
Filename Type Size Used Priority /dev/dm-8 partition 7809020 0 -1