Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#70830 - [systemd] 248-2 fails to decrypt multiple volumes with same passphrase
Attached to Project:
Arch Linux
Opened by Federico (fedev) - Wednesday, 12 May 2021, 23:39 GMT
Last edited by Toolybird (Toolybird) - Saturday, 15 April 2023, 22:36 GMT
Opened by Federico (fedev) - Wednesday, 12 May 2021, 23:39 GMT
Last edited by Toolybird (Toolybird) - Saturday, 15 April 2023, 22:36 GMT
|
DetailsDescription:
This is very similar to https://bugs.archlinux.org/task/70272. The initial difference with that ticket (which might not be so different as I'll explain) is that this Luks volume is encrypted by password and not a key-file. Why I said that it might not be so different after all is that I have two volumes and while the first is decrypted, the second isn't. It seems the reason behind is is that systemd stores the passphrase temporarily as a file as it tries the same passphrase for different volumes. This can be seen in the logs: May 13 07:19:18 archlinux systemd-tty-ask-password-agent[315]: Failed to send: No such file or directory May 13 07:19:18 archlinux systemd-tty-ask-password-agent[315]: Invalid password file /run/systemd/ask-password/ask.RpMg9u May 13 07:19:18 archlinux systemd-tty-ask-password-agent[315]: Failed to process password: No such file or directory Additional info: * package version(s): systemd 248.2-2 (I'll test with previous version and report back) Steps to reproduce: - Power-up - Provide Luks passphrase - Observe the drive failing to decrypt and mount |
This task depends upon
Skipping "/boot/EFI/systemd/systemd-bootx64.efi", since a newer boot loader version exists already.
Skipping "/boot/EFI/BOOT/BOOTX64.EFI", since a newer boot loader version exists already.
What did work in the end was to use snapper to revert to a previous snapshot (still with systemd at 248-5). What is curious is that at that point, while an error was still showing:
May 13 08:24:07 archlinux systemd-tty-ask-password-agent[311]: Invalid password file /run/systemd/ask-password/ask.rJg049
May 13 08:24:07 archlinux systemd-tty-ask-password-agent[311]: Failed to process password: Bad message
The system was able to unlock the drive and boot normally. Notice that the error is not the same.
May 14 09:24:56 archlinux systemd-tty-ask-password-agent[320]: Failed to send: No such file or directory
May 14 09:24:56 archlinux systemd-tty-ask-password-agent[320]: Invalid password file /run/systemd/ask-password/ask.Uelawq
May 14 09:24:56 archlinux systemd-tty-ask-password-agent[320]: Failed to process password: No such file or directory
There are times in which all volumes end-up mounted as expected (archroot resides in a single PV, archhome is a VG that spans across 2 PVs) despite of the error. As for the times when it did fail, it seems the issue was not really that the volumes failed to decrypt (which is what I thought was going on initially). When it failed and dropped me to the emergency console, all I had to do in order to complete the successful boot was:
<code>
vgchange -ay
exit
</code>
That'd mean that the volumes were unlocked, just not activated.
So here is a comparison of when it fails against when it works:
FAILS:
May 14 09:20:43 archlinux lvm[473]: pvscan[473] PV /dev/mapper/nvme0p3crypt online, VG archhome incomplete (need 1).
May 14 09:20:48 archlinux lvm[819]: pvscan[819] PV /dev/mapper/nvme1p1crypt online, VG archhome is complete.
May 14 09:20:48 archlinux lvm[819]: pvscan[819] VG archhome run autoactivation.
May 14 09:20:48 archlinux lvm[819]: 0 logical volume(s) in volume group "archhome" now active
May 14 09:20:48 archlinux lvm[819]: archhome: autoactivation failed.
WORKS:
May 14 09:24:58 archlinux lvm[498]: pvscan[498] PV /dev/mapper/nvme0p3crypt online, VG archhome incomplete (need 1).
May 14 09:25:01 archlinux lvm[650]: pvscan[650] PV /dev/mapper/nvme1p1crypt online, VG archhome is complete.
May 14 09:25:01 archlinux lvm[650]: pvscan[650] VG archhome run autoactivation.
May 14 09:25:01 archlinux lvm[650]: 1 logical volume(s) in volume group "archhome" now active
When it does fail, I also see (these lines are not present when it works):
May 14 09:20:48 archlinux systemd[1]: lvm2-pvscan@254:4.service: Main process exited, code=exited, status=5/NOTINSTALLED
May 14 09:20:48 archlinux systemd[1]: lvm2-pvscan@254:4.service: Failed with result 'exit-code'.
Let me know if there is anything else I could be looking at or help with.
I don't see the errors from "systemd-tty-ask-password-agent" anymore.
This does sound more of a work-around rather than a fix though.
I've noticed a very similar issue, and I'm not sure if this is an upstream thing or not
My setup has 2x LUKS volumes that are encrypted with different keys (in terms of cryptsetup keyslots) but these keys are protected with the same passphrase
- the initramfs boots, and prompts me to enter the passphrase
- if I type this correctly, then both volumes are unlocked and the rest of my system boots as expected, I am not prompted for a passphrase for the second volume
- however, at the first passphrase prompt, if I make a mistake, I will get per-volume passphrase prompts, so I will need to type my passphrase correctly two more times (or three more times when there are 3x LUKS volumes)
I guess I would expect to only have to enter the passphrase correctly once, no matter how many volumes I have, and no matter how many previous attempts were incorrect (as the first path seems to suggest that a correct entry will be applied to as many matching volumes as possible)
I have already used /etc/crypttab and key files (stored in /root) to defer unlocking of my LUKS volumes until later in the boot process, so I'm aware of this workaround
The 2x volumes I need to unlock during initramfs are my / (root) volume and the swap volume I use for hibernate+resume, so I cannot reduce the number of volumes any further without losing hibernate capability
I can confirm that I was able to reproduce this just last week on systemd 253.2-2-arch and kernel 6.2.9-arch1-1